diff --git a/lib/builder/webpack/base.config.js b/lib/builder/webpack/base.config.js index 194798a518..fcf07fea54 100644 --- a/lib/builder/webpack/base.config.js +++ b/lib/builder/webpack/base.config.js @@ -15,8 +15,6 @@ const WarnFixPlugin = require('./plugins/warnfix') |-------------------------------------------------------------------------- */ module.exports = function webpackBaseConfig({ name, isServer }) { - const nodeModulesDir = join(this.options.nuxtDir, 'node_modules') - const config = { name, devtool: this.options.dev ? 'cheap-module-eval-source-map' : false, @@ -48,16 +46,10 @@ module.exports = function webpackBaseConfig({ name, isServer }) { 'assets': join(this.options.srcDir, 'assets'), 'static': join(this.options.srcDir, 'static') }, - modules: [ - ...this.options.modulesDir, - nodeModulesDir - ] + modules: this.options.modulesDir }, resolveLoader: { - modules: [ - ...this.options.modulesDir, - nodeModulesDir - ] + modules: this.options.modulesDir }, module: { noParse: /es6-promise\.js$/, // Avoid webpack shimming process diff --git a/lib/builder/webpack/client.config.js b/lib/builder/webpack/client.config.js index 86eac1a0dc..a4c3f92da6 100644 --- a/lib/builder/webpack/client.config.js +++ b/lib/builder/webpack/client.config.js @@ -149,7 +149,7 @@ module.exports = function webpackClientConfig() { if (this.options.build.uglify !== false) { config.plugins.push( new UglifyJSPlugin(Object.assign({ - cache: true, + // cache: true, sourceMap: true, parallel: true, extractComments: { diff --git a/lib/common/options.js b/lib/common/options.js index e4aa155067..82f1bb4f97 100755 --- a/lib/common/options.js +++ b/lib/common/options.js @@ -59,6 +59,10 @@ Options.from = function (_options) { } options.modulesDir = options.modulesDir.filter(dir => hasValue(dir)).map(dir => resolve(options.rootDir, dir)) + // Always add nuxt to modulesDir array + const nuxtModulesDir = join(options.nuxtDir, 'node_modules') + options.modulesDir.push(nuxtModulesDir) + // If app.html is defined, set the template path to the user template options.appTemplatePath = resolve(options.buildDir, 'views/app.template.html') if (existsSync(join(options.srcDir, 'app.html'))) {