Skip to content

VUE CLI with webpack 4 does not support chainWebpack properly #1310

@LanFeusT23

Description

@LanFeusT23

Version

3.0.0-beta.10

Reproduction link

https://github.com/LanFeusT23/vue-cli-webpack-issue

Steps to reproduce

vue create project
Add a vue.config.js file and tap into some loader options

// vue.config.js
module.exports = {
  chainWebpack: config => {
    config.module
      .rule('scss')
      .use('sass-loader')
      .tap(options =>
        merge(options, {
          includePaths: [path.resolve(__dirname, 'node_modules')],
        })
      )
  }
}

npm run serve

It will throw an error when trying to tap into the loader options

What is expected?

The options should be a an object with many more properties.

What is actually happening?

the options object only has the following properties:
{ compilerOpitons: { preserveWhitespace: false } }

options.loaders.scss throws an exception because options doesn't have any other properties added.


This worked fine until webpack 4 was released.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions