minor build script adjustments?
See original GitHub issueWe use slingshot for all our apps and try to use it with minimum modifications (after doing a remove-app, and re-populating our app) so that we always get the latest enhancments with minimum tweaking of the configuration. There are two specific things we always change for right from the start, and it seems to us like they would be the most common use-case, so we want to understand the reasoning, and if you’d be open to a PR for these minor adjustments.
It really comes down to the usage of npm run build
and npm run clean-dist
or npm run remove-dist
(we don’t see the need to distinguist, since webpack creates it anyway?). For the production build, the first thing we change is the output.path
in webpack.config.prod.js
(the dev config isn’t used). We point this to where we want it to go for our production release. This could be a static nginx public directory, or a static folder for any other server that may be serving static apps/resources. This will almost always be app-specific.
Ideally, we’d like to just change the output.path in webpack.config.prod.js and then execute:
npm run build
To populate whatever path was specified in the webpack config, and then
npm run clean
to remove it. Also, we almost always execute this from inside a global top-level build/docker script, so we just want the build
script to generate the bundle, and not also serve it up with npm run open:dist
.
The adjustments to the current scripts seem minimal. These would be:
- Remove the
&& npm run open:dist
fromscripts.build
. Is this a typical use case anyway? - Adjust the
remove-dist
script such that instead of doing arimraf ./dist
executed a new script in tools that did a rimraf of whatever was specified in the webpack output.path, rather than hard-codingdist
. - Maybe add a
clean
script that simply did the above, rather than distingusing between removing the dist folder and then re-creating it (what is the use-case since it get recreated by webpack anyway?).
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:18 (11 by maintainers)
Top GitHub Comments
I’m sorry this set for so long. After thinking about this, I’d vote to close to avoid creating confusion for others. Of course, anyone using this is free to alter as they see fit, but I’m not sold the confusion risk is worth the benefit on this. And changing the output directory manually is simple.
So I’d vote to close.
I don’t think we should move away from
dist/
. I am fine with having a single point of truth for what directory that is.