Closed CaioMatias closed 6 years ago
I think we should move (inline) all build configs that webpack uses into webpack (.babelrc, postcss.conf.js, etc)
Few things I'd like us to consider:
merge.smart
(one more set of docs I have to read to understand what's happening w/ the webpack config)I am actually partial to splitting configs out by what they handle i.e. JS, CSS, Assets, etc and merging them in the configs right before exporting so they are more approachable and its easy to see how a given import type is processed rather than a monolithic config for all import types.
I'll take a "monolithic" config over the current magic. Looking at webpack.base there's no way for me to know it's using postcss.conf.js or .babelrc. It's by each individual loaders convention. You have to sift through each loaders documentation to figure out they're loading a arbitrarily named config file in the project root. I'm cool keeping them seperate if we explicitly import them and put them in a folder. Also another issue we need to address is we are defining our browserlist in two places
100% agree on moving all configs that webpack uses into webpack and doing away with rc
files. My approach is a little more similar to the old gulp setup in the you would have separate files for each loader type and that file would have both dev and prod configs being setup and exported and then in an index.js
we would merge them into one config for each environment.
I agree right now its hard to follow whats happening because its both a monolith and we merge those monoliths to create environment configs.
For all intents and purposes if this PR works with our code as is, I say we merge once comments have been addressed and take a bigger refactor effort into another branch
I agree, If this works let's merge.
@rynocouse @unruffledBeaver: we'll need to do some decent amount of testing on this upgrade. If it check out, I'm okay with merging it in as a bump to 4.x is nice. We can riff on our overall webpack config in a separate PR.
I unintentionally closed this PR. Reopening.