use time-fix-plugin

This commit is contained in:
Pooya Parsa 2018-02-28 10:58:17 +03:30
parent a65db22701
commit 2c023899a2
5 changed files with 21 additions and 30 deletions

View File

@ -605,7 +605,8 @@ module.exports = class Builder {
publicPath: this.options.build.publicPath,
stats: this.webpackStats,
logLevel: 'silent',
watchOptions: this.options.watchers.webpack
watchOptions: this.options.watchers.webpack,
watchOffset: 0 // Handled by time-fix-plugin
},
this.options.build.devMiddleware
)

View File

@ -1,10 +1,12 @@
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const TimeFixPlugin = require('time-fix-plugin')
const { cloneDeep } = require('lodash')
const { join, resolve } = require('path')
const { isUrl, urlJoin } = require('../../common/utils')
const vueLoader = require('./vue-loader')
const styleLoader = require('./style-loader')
const TimeFixPlugin = require('./plugins/timefix')
const WarnFixPlugin = require('./plugins/warnfix')
/*

View File

@ -1,18 +0,0 @@
// Taken from https://github.com/egoist/poi/blob/3e93c88c520db2d20c25647415e6ae0d3de61145/packages/poi/lib/webpack/timefix-plugin.js#L1-L16
// Thanks to @egoist
module.exports = class TimeFixPlugin {
constructor(timefix = 5000) {
this.timefix = timefix
}
apply(compiler) {
compiler.hooks.watchRun.tap('timefix-plugin', (watching, callback) => {
watching.startTime += this.timefix
callback()
})
compiler.hooks.done.tap('timefix-plugin', stats => {
stats.startTime -= this.timefix
})
}
}

View File

@ -1,8 +1,7 @@
{
"name": "nuxt",
"version": "1.3.0",
"description":
"A minimalistic framework for server-rendered Vue.js applications (inspired by Next.js)",
"description": "A minimalistic framework for server-rendered Vue.js applications (inspired by Next.js)",
"contributors": [
{
"name": "Sebastien Chopin (@Atinux)"
@ -20,7 +19,10 @@
"type": "git",
"url": "git+https://github.com/nuxt/nuxt.js"
},
"files": ["bin", "lib"],
"files": [
"bin",
"lib"
],
"keywords": [
"nuxt",
"nuxt.js",
@ -38,13 +40,13 @@
"nuxt": "./bin/nuxt"
},
"nyc": {
"include": ["lib"]
"include": [
"lib"
]
},
"scripts": {
"test":
"npm run lint && nyc ava --verbose test/ -- && nyc report --reporter=html",
"test-appveyor":
"npm run lint && nyc ava --serial test/ -- && nyc report --reporter=html",
"test": "npm run lint && nyc ava --verbose test/ -- && nyc report --reporter=html",
"test-appveyor": "npm run lint && nyc ava --serial test/ -- && nyc report --reporter=html",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"lint": "eslint --ext .js,.vue bin/* build/ lib/ test/ examples/",
"precommit": "npm run lint",
@ -102,6 +104,7 @@
"server-destroy": "^1.0.1",
"source-map": "^0.7.0",
"style-resources-loader": "^1.0.0",
"time-fix-plugin": "^2.0.0",
"uglifyjs-webpack-plugin": "^1.2.2",
"upath": "^1.0.2",
"url-loader": "^0.6.2",
@ -150,7 +153,6 @@
"collective": {
"type": "opencollective",
"url": "https://opencollective.com/nuxtjs",
"logo":
"https://opencollective.com/nuxtjs/logo.txt?reverse=true&variant=variant2"
"logo": "https://opencollective.com/nuxtjs/logo.txt?reverse=true&variant=variant2"
}
}

View File

@ -7319,6 +7319,10 @@ through@^2.3.6:
version "2.3.8"
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
time-fix-plugin@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/time-fix-plugin/-/time-fix-plugin-2.0.0.tgz#d112f1e415b6ed269e008a42990ddbf8053fc315"
time-zone@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/time-zone/-/time-zone-1.0.0.tgz#99c5bf55958966af6d06d83bdf3800dc82faec5d"