mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-19 23:21:09 +00:00
use time-fix-plugin
This commit is contained in:
parent
a65db22701
commit
2c023899a2
@ -605,7 +605,8 @@ module.exports = class Builder {
|
|||||||
publicPath: this.options.build.publicPath,
|
publicPath: this.options.build.publicPath,
|
||||||
stats: this.webpackStats,
|
stats: this.webpackStats,
|
||||||
logLevel: 'silent',
|
logLevel: 'silent',
|
||||||
watchOptions: this.options.watchers.webpack
|
watchOptions: this.options.watchers.webpack,
|
||||||
|
watchOffset: 0 // Handled by time-fix-plugin
|
||||||
},
|
},
|
||||||
this.options.build.devMiddleware
|
this.options.build.devMiddleware
|
||||||
)
|
)
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||||
|
const TimeFixPlugin = require('time-fix-plugin')
|
||||||
const { cloneDeep } = require('lodash')
|
const { cloneDeep } = require('lodash')
|
||||||
const { join, resolve } = require('path')
|
const { join, resolve } = require('path')
|
||||||
|
|
||||||
const { isUrl, urlJoin } = require('../../common/utils')
|
const { isUrl, urlJoin } = require('../../common/utils')
|
||||||
|
|
||||||
const vueLoader = require('./vue-loader')
|
const vueLoader = require('./vue-loader')
|
||||||
const styleLoader = require('./style-loader')
|
const styleLoader = require('./style-loader')
|
||||||
const TimeFixPlugin = require('./plugins/timefix')
|
|
||||||
const WarnFixPlugin = require('./plugins/warnfix')
|
const WarnFixPlugin = require('./plugins/warnfix')
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -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
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
22
package.json
22
package.json
@ -1,8 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "nuxt",
|
"name": "nuxt",
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
"description":
|
"description": "A minimalistic framework for server-rendered Vue.js applications (inspired by Next.js)",
|
||||||
"A minimalistic framework for server-rendered Vue.js applications (inspired by Next.js)",
|
|
||||||
"contributors": [
|
"contributors": [
|
||||||
{
|
{
|
||||||
"name": "Sebastien Chopin (@Atinux)"
|
"name": "Sebastien Chopin (@Atinux)"
|
||||||
@ -20,7 +19,10 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/nuxt/nuxt.js"
|
"url": "git+https://github.com/nuxt/nuxt.js"
|
||||||
},
|
},
|
||||||
"files": ["bin", "lib"],
|
"files": [
|
||||||
|
"bin",
|
||||||
|
"lib"
|
||||||
|
],
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"nuxt",
|
"nuxt",
|
||||||
"nuxt.js",
|
"nuxt.js",
|
||||||
@ -38,13 +40,13 @@
|
|||||||
"nuxt": "./bin/nuxt"
|
"nuxt": "./bin/nuxt"
|
||||||
},
|
},
|
||||||
"nyc": {
|
"nyc": {
|
||||||
"include": ["lib"]
|
"include": [
|
||||||
|
"lib"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test":
|
"test": "npm run lint && nyc ava --verbose test/ -- && nyc report --reporter=html",
|
||||||
"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-appveyor":
|
|
||||||
"npm run lint && nyc ava --serial test/ -- && nyc report --reporter=html",
|
|
||||||
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
|
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
|
||||||
"lint": "eslint --ext .js,.vue bin/* build/ lib/ test/ examples/",
|
"lint": "eslint --ext .js,.vue bin/* build/ lib/ test/ examples/",
|
||||||
"precommit": "npm run lint",
|
"precommit": "npm run lint",
|
||||||
@ -102,6 +104,7 @@
|
|||||||
"server-destroy": "^1.0.1",
|
"server-destroy": "^1.0.1",
|
||||||
"source-map": "^0.7.0",
|
"source-map": "^0.7.0",
|
||||||
"style-resources-loader": "^1.0.0",
|
"style-resources-loader": "^1.0.0",
|
||||||
|
"time-fix-plugin": "^2.0.0",
|
||||||
"uglifyjs-webpack-plugin": "^1.2.2",
|
"uglifyjs-webpack-plugin": "^1.2.2",
|
||||||
"upath": "^1.0.2",
|
"upath": "^1.0.2",
|
||||||
"url-loader": "^0.6.2",
|
"url-loader": "^0.6.2",
|
||||||
@ -150,7 +153,6 @@
|
|||||||
"collective": {
|
"collective": {
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
"url": "https://opencollective.com/nuxtjs",
|
"url": "https://opencollective.com/nuxtjs",
|
||||||
"logo":
|
"logo": "https://opencollective.com/nuxtjs/logo.txt?reverse=true&variant=variant2"
|
||||||
"https://opencollective.com/nuxtjs/logo.txt?reverse=true&variant=variant2"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7319,6 +7319,10 @@ through@^2.3.6:
|
|||||||
version "2.3.8"
|
version "2.3.8"
|
||||||
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
|
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:
|
time-zone@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/time-zone/-/time-zone-1.0.0.tgz#99c5bf55958966af6d06d83bdf3800dc82faec5d"
|
resolved "https://registry.yarnpkg.com/time-zone/-/time-zone-1.0.0.tgz#99c5bf55958966af6d06d83bdf3800dc82faec5d"
|
||||||
|
Loading…
Reference in New Issue
Block a user