-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Calypso Build Package: Add webpack.config.js #31940
Conversation
'output-path': outputPath = path.join( __dirname, 'dist' ), | ||
'output-filename': outputFilename = '[name].js', | ||
'output-libary-target': outputLibraryTarget = 'window', | ||
} |
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.
This choice of parametrization is supposed to organically tap into Webpack's way of accepting command line args. We should be able to use this config file with Webpack's CLI, and override these args, e.g. webpack --config ./webpack.config.js --output-filename="[chunk].js"
.
(Meaning I'm trying to essentially re-use Webpack's API without adding any new constraints.)
154d718
to
9955795
Compare
FYI @jeffersonrabb This might provide a nicer interface than using individual Webpack config shards for Newspack. See Automattic/jetpack#11802 for how to use it 🙂 |
optimization: { | ||
minimize: ! isDevelopment, | ||
minimizer: Minify( { | ||
cache: process.env.CIRCLECI |
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.
Would we expect to parametrize all these process.env
variables?
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.
We've been discussing that, e.g. using the function's env
arg. We decided to merge this for an i1 since it seems to work well enough (see Automattic/jetpack#11802), and tackle those chores later.
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.
Let's get an alpha published and see how this plays out 🚀
9955795
to
9cab7af
Compare
Changes proposed in this Pull Request
See pafL3P-oe-p2:
The file used in here is essentially
webpack.config.extensions.js
minus the entry point magic, and minusCopyWebpackPlugin
(about whichyarn
complained that it wasn't installed 🙄 -- but we might be able to get rid of that anyway, see Automattic/jetpack#11801).Testing instructions
Verify that blocks are built in your Jetpack directories
_inc/blocks/
folder.Follow-up (this PR or separately)
Use this config file to build o2 blocks.
/cc @sirreal @simison