Closed vlad-zhukov closed 7 years ago
Interesting. I haven't used EnvironmentPlugin before... only DefinePlugin. Does this still produce both minified and unminified umd builds? How does it know what environment it's currently in when building? Is that related to the exported array?
module.exports = [devConfig, prodConfig]
EnvironmentPlugin works the same as DefinePlugin in this situation.
Webpack supports array of configs and it runs them synchronously one after another, but it's not a well-documented feature (like many others 😄 ). It's unrelated to EnvironmentPlugin.
Output bundles stay the same as before.
UMD build of most
exports to window.most
, see https://unpkg.com/most@1.4.0/dist/most.js
Sorry for not merging this yet. I like that you reduced all of the scripts boilerplate down into one line for the UMD builds, but I'm just a little hesitant about the all configs in one file + the exported array approach... How often is the exported array feature used by others? Do we know it's going to continue being available?
The ability to export arrays of configs is there for years (for example see https://github.com/webpack/webpack/issues/1122#issuecomment-107246046), the feature is just not documented well.
Since it's the only way to produce multiple bundles with one command I don't see why it's going to be removed.
Okay, I was just checking. I was reading through some old webpack 2 issues recently and saw they had removed some other feature. So, I wasn't sure how stable/safe that one was. I'll probably merge this tonight or some time this weekend.
This is now merged and in master. Thanks, @Vlad-Zhukov . 👍
Squashed webpack configs into a single file.