question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

minor build script adjustments?

See original GitHub issue

We 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:

  1. Remove the && npm run open:dist from scripts.build. Is this a typical use case anyway?
  2. Adjust the remove-dist script such that instead of doing a rimraf ./dist executed a new script in tools that did a rimraf of whatever was specified in the webpack output.path, rather than hard-coding dist.
  3. 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:18 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
coryhousecommented, Feb 19, 2018

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.

1reaction
kwelchcommented, Aug 22, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing custom build scripts | Apple Developer Documentation
Custom build scripts run in a temporary build environment where your source code may not be available. As a result, you need to...
Read more >
Run (build) number - Azure Pipelines | Microsoft Learn
You can customize how your pipeline runs are numbered. The default value for run number is $(Date:yyyyMMdd).$(Rev:r) .
Read more >
What exactly is the build number in MAJOR.MINOR ...
It just means I am fixing what I already published to work properly. I would also use this if I am working on...
Read more >
3 Common Tasks — The Yocto Project ® 4.1.999 documentation
3 Common Tasks . This chapter describes fundamental procedures such as creating layers, adding new software packages, extending or customizing images, ...
Read more >
Semantic Versioning 2.0.0 | Semantic Versioning
PATCH version when you make backwards compatible bug fixes. Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found