mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
perf,fix: source map improvements
This commit is contained in:
parent
87ac7d0cb4
commit
452747b3c4
@ -18,7 +18,6 @@ const WarnFixPlugin = require('./plugins/warnfix')
|
||||
module.exports = function webpackBaseConfig({ name, isServer }) {
|
||||
const config = {
|
||||
name,
|
||||
devtool: this.options.dev ? 'cheap-source-map' : false,
|
||||
entry: {
|
||||
app: null
|
||||
},
|
||||
@ -28,8 +27,7 @@ module.exports = function webpackBaseConfig({ name, isServer }) {
|
||||
chunkFilename: this.getFileName('chunk'),
|
||||
publicPath: (isUrl(this.options.build.publicPath)
|
||||
? this.options.build.publicPath
|
||||
: urlJoin(this.options.router.base, this.options.build.publicPath)),
|
||||
devtoolModuleFilenameTemplate: '[absolute-resource-path]'
|
||||
: urlJoin(this.options.router.base, this.options.build.publicPath))
|
||||
},
|
||||
performance: {
|
||||
maxEntrypointSize: 1000000,
|
||||
|
@ -33,6 +33,10 @@ module.exports = function webpackClientConfig() {
|
||||
config.entry.app = resolve(this.options.buildDir, 'client.js')
|
||||
config.entry.vendor = this.vendor()
|
||||
|
||||
// Config devtool
|
||||
config.devtool = this.options.dev ? 'cheap-source-map' : false
|
||||
config.output.devtoolModuleFilenameTemplate = '[absolute-resource-path]'
|
||||
|
||||
// Add CommonChunks plugin
|
||||
commonChunksPlugin.call(this, config)
|
||||
|
||||
|
@ -14,16 +14,18 @@ const base = require('./base.config.js')
|
||||
module.exports = function webpackServerConfig() {
|
||||
let config = base.call(this, { name: 'server', isServer: true })
|
||||
|
||||
// env object defined in nuxt.config.js
|
||||
// Env object defined in nuxt.config.js
|
||||
let env = {}
|
||||
each(this.options.env, (value, key) => {
|
||||
env['process.env.' + key] = (['boolean', 'number'].indexOf(typeof value) !== -1 ? value : JSON.stringify(value))
|
||||
})
|
||||
|
||||
// Config devtool
|
||||
config.devtool = this.options.dev ? 'cheap-source-map' : false
|
||||
|
||||
config = Object.assign(config, {
|
||||
target: 'node',
|
||||
node: false,
|
||||
devtool: 'source-map',
|
||||
entry: resolve(this.options.buildDir, 'server.js'),
|
||||
output: Object.assign({}, config.output, {
|
||||
filename: 'server-bundle.js',
|
||||
|
@ -163,7 +163,7 @@ Options.defaults = {
|
||||
uglify: {},
|
||||
publicPath: '/_nuxt/',
|
||||
filenames: {
|
||||
css: 'css/[name].[contenthash].css',
|
||||
css: '[name].[contenthash].css',
|
||||
manifest: 'manifest.[hash].js',
|
||||
vendor: 'vendor.[chunkhash].js',
|
||||
app: 'app.[chunkhash].js',
|
||||
|
Loading…
Reference in New Issue
Block a user