When selecting "separate config files", cli should .browserslistrc over package.json
See original GitHub issueVersion
3.0.0-alpha.9
Steps to reproduce
- vue create demo-app
- Select “In dedicated config files” on the question
"Where do you prefer placing config for Babel, PostCSS, ESLint, etc.?"
What is expected?
browserlist config to be in .browserlistrc file
What is actually happening?
The browserlist config is in the package.json
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Pierre GAMBAROTTO / Maquette_fork · GitLab - PLMlab - CNRS
Browserslist will take queries from tool option, browserslist config, .browserslistrc config, browserslist section in package.json or environment variables.
Read more >What is PostCSS? How to Use Plugins to Automate CSS Tasks
We can configure our command to run in PostCSS CLI with different options to get our desired result. Now to run the command...
Read more >babel/preset-env
json. This is useful for projects that use a browserslist config for files that won't be compiled with Babel.
Read more >How to include custom files with angular-cli build?
The "assets" property of angular-cli.json can be configured to include custom files in angular-cli webpack build. So, configure "assets" property value as ...
Read more >Getting started with Vue - Learn web development | MDN
Now, you will select how we want your config files to be managed. ... The Vue CLI will default to this package manager...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli/lib/util/configTransforms.js
By default, all configs are written into package.json. If the user selects “separate config files”, the tranforms defined in the above file will be used to extract configs from package.json into these files.
So you would have to define a new transform for the browserslist field in that file.
That could maybe be as simple as adding this to the export:
If we make this change, we have to make sure that these plugins actually respect .browserslistrc:
https://github.com/browserslist/browserslist#browserslist-
The .browserlistrc file seems to have a different syntax after all, it’s not 100% JSON? You might have to write a new transform for that, probably.