mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
remove webpack-stylish
more compact results and prevent duplicate warning and errors
This commit is contained in:
parent
da40bcf18b
commit
de847a7cd0
@ -42,9 +42,6 @@ export default class Builder {
|
|||||||
this.spinner = createSpinner({ minimal: this.options.minimalCLI })
|
this.spinner = createSpinner({ minimal: this.options.minimalCLI })
|
||||||
this.spinner.enabled = !this.options.test
|
this.spinner.enabled = !this.options.test
|
||||||
|
|
||||||
// Mute stats on dev
|
|
||||||
this.webpackStats = this.options.dev ? false : this.options.build.stats
|
|
||||||
|
|
||||||
// Helper to resolve build paths
|
// Helper to resolve build paths
|
||||||
this.relativeToBuild = (...args) =>
|
this.relativeToBuild = (...args) =>
|
||||||
relativeTo(this.options.buildDir, ...args)
|
relativeTo(this.options.buildDir, ...args)
|
||||||
@ -538,6 +535,14 @@ export default class Builder {
|
|||||||
return reject(err)
|
return reject(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.options.test) {
|
||||||
|
process.stdout.write(
|
||||||
|
'\n' +
|
||||||
|
stats.toString(this.options.build.stats) +
|
||||||
|
'\n'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -554,7 +559,7 @@ export default class Builder {
|
|||||||
Object.assign(
|
Object.assign(
|
||||||
{
|
{
|
||||||
publicPath: this.options.build.publicPath,
|
publicPath: this.options.build.publicPath,
|
||||||
stats: this.webpackStats,
|
stats: false,
|
||||||
logLevel: 'silent',
|
logLevel: 'silent',
|
||||||
watchOptions: this.options.watchers.webpack
|
watchOptions: this.options.watchers.webpack
|
||||||
},
|
},
|
||||||
|
@ -153,14 +153,10 @@ export default function webpackBaseConfig({ name, isServer }) {
|
|||||||
// Hide warnings about plugins without a default export (#1179)
|
// Hide warnings about plugins without a default export (#1179)
|
||||||
config.plugins.push(new WarnFixPlugin())
|
config.plugins.push(new WarnFixPlugin())
|
||||||
|
|
||||||
const shouldClearConsole =
|
|
||||||
this.options.build.stats !== false &&
|
|
||||||
this.options.build.stats !== 'errors-only'
|
|
||||||
|
|
||||||
// Add friendly error plugin
|
// Add friendly error plugin
|
||||||
config.plugins.push(
|
config.plugins.push(
|
||||||
new FriendlyErrorsWebpackPlugin({
|
new FriendlyErrorsWebpackPlugin({
|
||||||
clearConsole: shouldClearConsole,
|
clearConsole: true,
|
||||||
logLevel: 'WARNING'
|
logLevel: 'WARNING'
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -4,7 +4,6 @@ import _ from 'lodash'
|
|||||||
import webpack from 'webpack'
|
import webpack from 'webpack'
|
||||||
|
|
||||||
import HTMLPlugin from 'html-webpack-plugin'
|
import HTMLPlugin from 'html-webpack-plugin'
|
||||||
import StylishPlugin from 'webpack-stylish'
|
|
||||||
import BundleAnalyzer from 'webpack-bundle-analyzer'
|
import BundleAnalyzer from 'webpack-bundle-analyzer'
|
||||||
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
|
||||||
|
|
||||||
@ -128,11 +127,6 @@ export default function webpackClientConfig() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/webpack-contrib/webpack-stylish
|
|
||||||
if (!this.options.dev && !this.options.test) {
|
|
||||||
config.plugins.push(new StylishPlugin())
|
|
||||||
}
|
|
||||||
|
|
||||||
// Webpack Bundle Analyzer
|
// Webpack Bundle Analyzer
|
||||||
if (this.options.build.analyze) {
|
if (this.options.build.analyze) {
|
||||||
config.plugins.push(
|
config.plugins.push(
|
||||||
|
@ -80,6 +80,9 @@ export default {
|
|||||||
children: false,
|
children: false,
|
||||||
modules: false,
|
modules: false,
|
||||||
colors: true,
|
colors: true,
|
||||||
|
// Warning and Erros will be handled by friendly-errors-plugin
|
||||||
|
warnings: false,
|
||||||
|
errors: false,
|
||||||
excludeAssets: [
|
excludeAssets: [
|
||||||
/.map$/,
|
/.map$/,
|
||||||
/index\..+\.html$/,
|
/index\..+\.html$/,
|
||||||
|
@ -114,8 +114,7 @@
|
|||||||
"webpack-bundle-analyzer": "^2.11.1",
|
"webpack-bundle-analyzer": "^2.11.1",
|
||||||
"webpack-dev-middleware": "^3.0.1",
|
"webpack-dev-middleware": "^3.0.1",
|
||||||
"webpack-hot-middleware": "^2.21.2",
|
"webpack-hot-middleware": "^2.21.2",
|
||||||
"webpack-node-externals": "^1.6.0",
|
"webpack-node-externals": "^1.6.0"
|
||||||
"webpack-stylish": "^0.1.6"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@expo/spawn-async": "^1.3.0",
|
"@expo/spawn-async": "^1.3.0",
|
||||||
|
36
yarn.lock
36
yarn.lock
@ -3476,10 +3476,6 @@ ipaddr.js@1.6.0:
|
|||||||
version "1.6.0"
|
version "1.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.6.0.tgz#e3fa357b773da619f26e95f049d055c72796f86b"
|
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.6.0.tgz#e3fa357b773da619f26e95f049d055c72796f86b"
|
||||||
|
|
||||||
irregular-plurals@^1.0.0:
|
|
||||||
version "1.4.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/irregular-plurals/-/irregular-plurals-1.4.0.tgz#2ca9b033651111855412f16be5d77c62a458a766"
|
|
||||||
|
|
||||||
is-absolute-url@^2.0.0:
|
is-absolute-url@^2.0.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6"
|
resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6"
|
||||||
@ -5266,12 +5262,6 @@ pleeease-filters@^4.0.0:
|
|||||||
onecolor "^3.0.4"
|
onecolor "^3.0.4"
|
||||||
postcss "^6.0.1"
|
postcss "^6.0.1"
|
||||||
|
|
||||||
plur@^2.1.2:
|
|
||||||
version "2.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/plur/-/plur-2.1.2.tgz#7482452c1a0f508e3e344eaec312c91c29dc655a"
|
|
||||||
dependencies:
|
|
||||||
irregular-plurals "^1.0.0"
|
|
||||||
|
|
||||||
pluralize@^7.0.0:
|
pluralize@^7.0.0:
|
||||||
version "7.0.0"
|
version "7.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777"
|
resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777"
|
||||||
@ -5831,10 +5821,6 @@ prettier@^1.11.1:
|
|||||||
version "1.11.1"
|
version "1.11.1"
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75"
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75"
|
||||||
|
|
||||||
pretty-bytes@^4.0.2:
|
|
||||||
version "4.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9"
|
|
||||||
|
|
||||||
pretty-error@^2.0.2:
|
pretty-error@^2.0.2:
|
||||||
version "2.1.1"
|
version "2.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.1.tgz#5f4f87c8f91e5ae3f3ba87ab4cf5e03b1a17f1a3"
|
resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.1.tgz#5f4f87c8f91e5ae3f3ba87ab4cf5e03b1a17f1a3"
|
||||||
@ -6962,7 +6948,7 @@ test-exclude@^4.1.1:
|
|||||||
read-pkg-up "^1.0.1"
|
read-pkg-up "^1.0.1"
|
||||||
require-main-filename "^1.0.1"
|
require-main-filename "^1.0.1"
|
||||||
|
|
||||||
text-table@^0.2.0, text-table@~0.2.0:
|
text-table@~0.2.0:
|
||||||
version "0.2.0"
|
version "0.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
|
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
|
||||||
|
|
||||||
@ -7477,18 +7463,6 @@ webpack-sources@^1.0.1, webpack-sources@^1.1.0:
|
|||||||
source-list-map "^2.0.0"
|
source-list-map "^2.0.0"
|
||||||
source-map "~0.6.1"
|
source-map "~0.6.1"
|
||||||
|
|
||||||
webpack-stylish@^0.1.6:
|
|
||||||
version "0.1.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/webpack-stylish/-/webpack-stylish-0.1.6.tgz#66edd985aaa00d9649a37762c863ef63fb8b4241"
|
|
||||||
dependencies:
|
|
||||||
chalk "^2.3.0"
|
|
||||||
log-symbols "^2.2.0"
|
|
||||||
plur "^2.1.2"
|
|
||||||
pretty-bytes "^4.0.2"
|
|
||||||
strip-ansi "^4.0.0"
|
|
||||||
text-table "^0.2.0"
|
|
||||||
wordwrap "^1.0.0"
|
|
||||||
|
|
||||||
webpack@^4.2.0:
|
webpack@^4.2.0:
|
||||||
version "4.2.0"
|
version "4.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.2.0.tgz#a4f80807651a0e611bb09609600dc266262efcc1"
|
resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.2.0.tgz#a4f80807651a0e611bb09609600dc266262efcc1"
|
||||||
@ -7559,14 +7533,14 @@ wordwrap@0.0.2:
|
|||||||
version "0.0.2"
|
version "0.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f"
|
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f"
|
||||||
|
|
||||||
wordwrap@^1.0.0, wordwrap@~1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
|
|
||||||
|
|
||||||
wordwrap@~0.0.2:
|
wordwrap@~0.0.2:
|
||||||
version "0.0.3"
|
version "0.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
|
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
|
||||||
|
|
||||||
|
wordwrap@~1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
|
||||||
|
|
||||||
worker-farm@1.5.0:
|
worker-farm@1.5.0:
|
||||||
version "1.5.0"
|
version "1.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.5.0.tgz#adfdf0cd40581465ed0a1f648f9735722afd5c8d"
|
resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.5.0.tgz#adfdf0cd40581465ed0a1f648f9735722afd5c8d"
|
||||||
|
Loading…
Reference in New Issue
Block a user