mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 23:32:38 +00:00
always add nuxt to modulesDir
This commit is contained in:
parent
adb5966ed2
commit
a4e2a7cd65
@ -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
|
||||
|
@ -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: {
|
||||
|
@ -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'))) {
|
||||
|
Loading…
Reference in New Issue
Block a user