pass 'this nuxt' context in extend webpack config

// nuxt.config
build: {
    extend (config, {dev, isClient}) {
      // get this context here
      config.resolve.alias['~services'] = join(this.srcDir, 'services');
    },
}
This commit is contained in:
Walter Ye 2017-04-01 13:34:09 +08:00 committed by GitHub
parent d576dad069
commit e7bcdc736e

View File

@ -105,7 +105,7 @@ export default function () {
}
// Extend config
if (typeof this.options.build.extend === 'function') {
this.options.build.extend(config, {
this.options.build.extend.call(this, config, {
dev: this.dev,
isClient: true
})