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

fix(cli-app-scripts): use the same build dir for modes #302

Merged
merged 1 commit into from
Feb 18, 2020

Conversation

varl
Copy link
Contributor

@varl varl commented Feb 18, 2020

This removes the devOut path and usage of it, instead opting for
building the development build and production build into the same
folder: ./build.

For libraries in monorepo situations this is important as they will look
up the main or module key in the package.json file, which is usually set
to e.g. ./build/{cjs,es}/lib.js when using the cli-app-scripts to build
the lib.

This removes the devOut path and usage of it, instead opting for
building the development build and production build into the same
folder: ./build.

For libraries in monorepo situations this is important as they will look
up the main or module key in the package.json file, which is usually set
to e.g. ./build/{cjs,es}/lib.js when using the cli-app-scripts to build
the lib.
@varl varl requested a review from amcgee February 18, 2020 13:32
Copy link
Member

@amcgee amcgee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question, generally looks good!

@@ -81,6 +81,8 @@ const compileLibrary = async ({ config, paths, mode, watch }) => {
process.exit(1)
}
} else {
fs.ensureDirSync(outDir)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason not to remove the existing directory before running the compiler in watch mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Webpack Dev Server crashes if the directory disappears and needs to be restarted. Just overwriting the files works however, but we need to ensure that the dir is there on first run.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meaning webpack devserver somewhere else in the monorepo? Unfortunate, but OK for now 👌

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, for example when I run Storybook for ui-core and the build folder disappears, Storybook crashes, so deleting it on every rebuild is a bit annoying.

@varl varl merged commit dd2802b into master Feb 18, 2020
@varl varl deleted the fix/dev-output-to-build-dir branch February 18, 2020 15:14
dhis2-bot added a commit that referenced this pull request Feb 18, 2020
## [3.2.4](v3.2.3...v3.2.4) (2020-02-18)

### Bug Fixes

* **cli-app-scripts:** use the same build dir for modes ([#302](#302)) ([dd2802b](dd2802b))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 3.2.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants