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 }) {
|
module.exports = function webpackBaseConfig({ name, isServer }) {
|
||||||
const nodeModulesDir = join(this.options.nuxtDir, 'node_modules')
|
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
name,
|
name,
|
||||||
devtool: this.options.dev ? 'cheap-module-eval-source-map' : false,
|
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'),
|
'assets': join(this.options.srcDir, 'assets'),
|
||||||
'static': join(this.options.srcDir, 'static')
|
'static': join(this.options.srcDir, 'static')
|
||||||
},
|
},
|
||||||
modules: [
|
modules: this.options.modulesDir
|
||||||
...this.options.modulesDir,
|
|
||||||
nodeModulesDir
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
resolveLoader: {
|
resolveLoader: {
|
||||||
modules: [
|
modules: this.options.modulesDir
|
||||||
...this.options.modulesDir,
|
|
||||||
nodeModulesDir
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
noParse: /es6-promise\.js$/, // Avoid webpack shimming process
|
noParse: /es6-promise\.js$/, // Avoid webpack shimming process
|
||||||
|
@ -149,7 +149,7 @@ module.exports = function webpackClientConfig() {
|
|||||||
if (this.options.build.uglify !== false) {
|
if (this.options.build.uglify !== false) {
|
||||||
config.plugins.push(
|
config.plugins.push(
|
||||||
new UglifyJSPlugin(Object.assign({
|
new UglifyJSPlugin(Object.assign({
|
||||||
cache: true,
|
// cache: true,
|
||||||
sourceMap: true,
|
sourceMap: true,
|
||||||
parallel: true,
|
parallel: true,
|
||||||
extractComments: {
|
extractComments: {
|
||||||
|
@ -59,6 +59,10 @@ Options.from = function (_options) {
|
|||||||
}
|
}
|
||||||
options.modulesDir = options.modulesDir.filter(dir => hasValue(dir)).map(dir => resolve(options.rootDir, dir))
|
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
|
// If app.html is defined, set the template path to the user template
|
||||||
options.appTemplatePath = resolve(options.buildDir, 'views/app.template.html')
|
options.appTemplatePath = resolve(options.buildDir, 'views/app.template.html')
|
||||||
if (existsSync(join(options.srcDir, 'app.html'))) {
|
if (existsSync(join(options.srcDir, 'app.html'))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user