-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add initial webpack config #55
Add initial webpack config #55
Conversation
"lint": "npm run gulp scripts:lint styles:lint", | ||
"watch": "npm run gulp watch", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"build:legacy": "cross-env BROWSERSLIST_ENV=legacy webpack", |
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.
Split code for modern and legacy browsers is a great thing but it adds some inconveniences to the developing process:
- The decision which bundle to use should be made on the backend, probably by checking the user agent. I'm not sure if each project is ready to implement this extra logic. And I guess we currently don't have a solution from the box.
- If we use
legacy
polyfilled code by default during the development, we need to check themodern
code as well in order to make sure it works the same way. That's kinda extra work :) - Polyfilled files are outputting to the folder named
legacy
, which is a common way to name bundle for old browsers, but also might be confused with "legacy" code in the project if it has some :)
Probably we'd better make a code-splitting optional if it is possible, what do you think? :)
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.
@sme12 yeah, I also been thinking whether we need to have this sort of setup by default...
- There's also this
<script nomodule>
approach. It requires a bit of JS for browsers that don't understandnomodule
attribute. Frankly, I need to revisit this topic to see if it makes more sense. - That's true. Even though one could argue that you mostly do development in your favorite browser and then still have to test in, say, IE afterwards. But yes, it adds up this extra step of
npm run build
. In a traditional setup you can go away with the results yielded by already runningnpm start
. legacy
/modern
words in context of bundling are somewhat common, for example here and here, so I just excused myself from another naming task 😁 However, I see your concern, among other reasonable choices I found wereclassic
/module
as seen here (although they convey a slightly different meaning compared to the current solution) and simplyold
/new
(I also like that both words have equal number of characters 🙂).
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.
Looking good.. lets keep the ball rolling 🐤
So here's the initial webpack config. It's still missing a lot of things, but for now following needs from #54 were addressed:
webpack-merge
assets-manifest.json
is being generated.env
is loaded viadotenv
(there's alsocross-env
for Browserslist)core-js
updatednode-sass
replaced withsass
@mi2oon I'm keeping to our present structure with Yeoman for the time being.
That's it so far 🙂 Let me know what you think