-
Notifications
You must be signed in to change notification settings - Fork 16
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
Conversation
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.
There was a problem hiding this 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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 👌
There was a problem hiding this comment.
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.
## [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))
🎉 This PR is included in version 3.2.4 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.