Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project-based Webpack config is overwritten by lib configuration under --target lib #1252

Closed
doublemarked opened this issue May 9, 2018 · 1 comment

Comments

@doublemarked
Copy link

doublemarked commented May 9, 2018

Version

3.0.0-beta.9

Reproduction link

https://github.com/doublemarked/vue-libconf-issues

Steps to reproduce

  1. git clone https://github.com/doublemarked/vue-libconf-issues.git
  2. Observe the vue.configureWebpack.publicPath key/val in package.json.
  3. npm install && npm run build
  4. Observe the public path setting is not present in the resulting build artifacts: grep -R "CLOBB" dist/

What is expected?

It should be possible to use Vue webpack configuration placed in package.json or vue.config.js to configure all webpack settings.

What is actually happening?

Within the build process, webpack customizations (either via configureWebpack or chainWebpack) are applied before the configuration from resolveLibConfig.js. This makes it not possible to use project-based webpack config to override settings from the lib config.

Note: This also applies to --target wc

@doublemarked doublemarked changed the title Project-based Webpack config (i.e. package.json or vue.config.js) is overwritten by lib configuration under --target lib Project-based Webpack config (i.e. package.json or vue.config.js) is overwritten by lib configuration under --target lib May 9, 2018
@doublemarked doublemarked changed the title Project-based Webpack config (i.e. package.json or vue.config.js) is overwritten by lib configuration under --target lib Project-based Webpack config is overwritten by lib configuration under --target lib May 9, 2018
@yyx990803
Copy link
Member

Some output options are intentionally applied after user configurations because the user may have a vue.config.js with app-specific modifications and still want to use build --target lib at the same time for some components.

Closing since after c3d246f and 66bab8c it seems there's no need to tweak them anymore, but let me know if there are other valid use cases that require changing them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants