-
Notifications
You must be signed in to change notification settings - Fork 101
fix(dev): inherit local webpack.dev.config.js #74
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(dev): inherit local webpack.dev.config.js #74
Conversation
regisb
left a comment
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.
I didn't test this change myself but it looks good to me!
|
@arbrandes would you mind having a quick look ? |
arbrandes
left a comment
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.
Approved, with a single question which you can tackle at your discretion.
|
|
||
| const baseDevConfig = require('@edx/frontend-build/config/webpack.dev.config.js'); | ||
| const baseDevConfig = ( | ||
| !fs.existsSync('./webpack.dev.config.js') |
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.
Nit: wouldn't an affirmation make the code a bit more readable, here? (As opposed to a negation.)
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.
From a performance viewpoint, most MFEs use the resolved frontend-platform config file (whereas the negation)
But I'd rather have a clearer code reading instead, So I've switched to the affirmative.
@arbrandes
| ENV PUBLIC_PATH='/{{ app["name"] }}/' | ||
| EXPOSE {{ app['port'] }} | ||
| CMD ["npm", "run", "start"] | ||
| CMD ["npm", "run", "start", "---", "--config", "./webpack.dev-tutor.config.js"] |
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.
Nice find!
fixes issue overhangio#71 for to account for MFEs that have an existing webpack.dev.config.js
886c78b to
bb150df
Compare
A small fix for issue #71 to avoid overwriting the local
webpack.dev.config.jsin MFEs with the plugin's version of the file mounted at container startThe MFEs targetted by this all have a local
webpack.dev.config.js. Here are the ones branched for the olive release:To account for the 2 possible cases for all MFEs, the fix was tested and confirmed to work with:
frontend-app-gradebook(using local config)frontend-app-learning(using config resolved fromfrontend-platform)The modification in
Dockerfilewon't trigger a long image rebuild as it affects only the last step (CMD).My choice at the moment was to rename the plugin's
webpack.dev.config.jstowebpack.dev-tutor.config.js.Please tell me if another file name or location is preferable (e.g.
tutor/webpack.dev.config.js).