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

Enable options to load different config files from command-line or npm script #37

Closed
filipposarzana opened this issue Dec 28, 2017 · 3 comments

Comments

@filipposarzana
Copy link

Probably would be a great improvement to have and option to load different configuration files either from npm run size or from cli

Just like .dotenv file you could have .size-limit which will always be the default one and eventually .size-limit.prod

@ai
Copy link
Owner

ai commented Dec 28, 2017

Hm. Why do you need different environment? Maybe there is a more simple way.

@SivanMehta
Copy link
Contributor

If you're just looking for cli options you can just disable the internal webpack and manually run your own webpack build.

For example, you can try adding this within your package.json

"scripts": {
  "build": "webpack --config your-custom-config-file.js dist/output.js",
  "size": "npm run build && size-limit"
},
"size-limit": [
  {
     "limit": "300 KB",
     "webpack": false,
     "path": "dist/output.js"
  }
]

Now, npm run size will just run with whatever configuration files you provide.

@ai
Copy link
Owner

ai commented Jan 14, 2018

All config options are available by CLI option. So if you want to have different configs:

size-limit 10 KB app.js --no-webpack 

I think CLI options will be enough.

But I will open this feature request again when somebody will show me use case for different configs.

@ai ai closed this as completed Jan 14, 2018
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

3 participants