mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
chore: minor webpack fixes
This commit is contained in:
parent
765f560b8c
commit
4c5c7b3bb4
@ -18,8 +18,8 @@ import upath from 'upath'
|
|||||||
import { r, wp, wChunk, createRoutes, parallel, relativeTo, waitFor, createSpinner } from '../common/utils'
|
import { r, wp, wChunk, createRoutes, parallel, relativeTo, waitFor, createSpinner } from '../common/utils'
|
||||||
import Options from '../common/options'
|
import Options from '../common/options'
|
||||||
|
|
||||||
import ClientWebpackConfig from './webpack/client.config'
|
import ClientWebpackConfig from './webpack/client'
|
||||||
import ServerWebpackConfig from './webpack/server.config'
|
import ServerWebpackConfig from './webpack/server'
|
||||||
|
|
||||||
const debug = Debug('nuxt:build')
|
const debug = Debug('nuxt:build')
|
||||||
debug.color = 2 // Force green color
|
debug.color = 2 // Force green color
|
||||||
|
@ -168,8 +168,8 @@ export default class WebpackBaseConfig {
|
|||||||
// Hide warnings about plugins without a default export (#1179)
|
// Hide warnings about plugins without a default export (#1179)
|
||||||
plugins.push(new WarnFixPlugin())
|
plugins.push(new WarnFixPlugin())
|
||||||
|
|
||||||
if (!this.options.test) {
|
|
||||||
// Build progress indicator
|
// Build progress indicator
|
||||||
|
if (!this.options.test) {
|
||||||
if (this.options.build.profile) {
|
if (this.options.build.profile) {
|
||||||
plugins.push(new webpack.ProgressPlugin({ profile: true }))
|
plugins.push(new webpack.ProgressPlugin({ profile: true }))
|
||||||
} else {
|
} else {
|
||||||
@ -181,11 +181,15 @@ export default class WebpackBaseConfig {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Add stats plugin
|
// Add stats plugin
|
||||||
|
if (!this.options.dev) {
|
||||||
plugins.push(new StatsPlugin(this.options.build.stats))
|
plugins.push(new StatsPlugin(this.options.build.stats))
|
||||||
|
}
|
||||||
|
|
||||||
// Add friendly error plugin
|
// Add friendly error plugin
|
||||||
|
if (!this.options.dev && !this.options.test) {
|
||||||
plugins.push(
|
plugins.push(
|
||||||
new FriendlyErrorsWebpackPlugin({
|
new FriendlyErrorsWebpackPlugin({
|
||||||
clearConsole: true,
|
clearConsole: true,
|
||||||
@ -193,6 +197,7 @@ export default class WebpackBaseConfig {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return plugins
|
return plugins
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import BundleAnalyzer from 'webpack-bundle-analyzer'
|
|||||||
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
|
||||||
|
|
||||||
import VueSSRClientPlugin from './plugins/vue/client'
|
import VueSSRClientPlugin from './plugins/vue/client'
|
||||||
import BaseConfig from './base.config'
|
import BaseConfig from './base'
|
||||||
|
|
||||||
export default class WebpackClientConfig extends BaseConfig {
|
export default class WebpackClientConfig extends BaseConfig {
|
||||||
constructor(builder) {
|
constructor(builder) {
|
||||||
|
@ -4,7 +4,7 @@ import fs from 'fs'
|
|||||||
import webpack from 'webpack'
|
import webpack from 'webpack'
|
||||||
import nodeExternals from 'webpack-node-externals'
|
import nodeExternals from 'webpack-node-externals'
|
||||||
|
|
||||||
import BaseConfig from './base.config'
|
import BaseConfig from './base'
|
||||||
import VueSSRServerPlugin from './plugins/vue/server'
|
import VueSSRServerPlugin from './plugins/vue/server'
|
||||||
|
|
||||||
export default class WebpackServerConfig extends BaseConfig {
|
export default class WebpackServerConfig extends BaseConfig {
|
||||||
|
@ -4,7 +4,7 @@ import path from 'path'
|
|||||||
import ـ from 'lodash'
|
import ـ from 'lodash'
|
||||||
import createResolver from 'postcss-import-resolver'
|
import createResolver from 'postcss-import-resolver'
|
||||||
|
|
||||||
import { isPureObject } from '../../common/utils'
|
import { isPureObject } from '../../../common/utils'
|
||||||
|
|
||||||
export default function postcssConfig() {
|
export default function postcssConfig() {
|
||||||
let config = ـ.cloneDeep(this.options.build.postcss)
|
let config = ـ.cloneDeep(this.options.build.postcss)
|
||||||
|
Loading…
Reference in New Issue
Block a user