3

I have a webpack config using laravel with vue, I am transforming it to vue spa app using vue-cli-3. But I am not able to understand how I can change mix config to vue.config.js. This is my webpack.mix.js config.

resolve: {
    modules: [
        'node_modules',
        path.resolve(__dirname, 'resources/assets/js'),
        path.resolve(__dirname, 'resources/assets/svg')
      ]
  }

I want to resolve this in vue.config.js. How can I do it? Any recommendation?

1 Answer 1

1

The code snippet you have is just a partial webpack configuration.

The vue-cli also accepts applying an arbitrary partial to its own underlying configuration, using the vue.config.js and its configureWebpack property (docs here):

So you would do something like this:

// vue.config.js
module.exports = {
  configureWebpack: {
    resolve: {
      modules: [
        'node_modules',
        path.resolve(__dirname, 'resources/assets/js'),
        path.resolve(__dirname, 'resources/assets/svg')
      ]
    }
  }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.