Skip to content

tutorial on working with multiple compilations/configs #559

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

Closed
graingert opened this issue Jan 23, 2017 · 4 comments
Closed

tutorial on working with multiple compilations/configs #559

graingert opened this issue Jan 23, 2017 · 4 comments

Comments

@graingert
Copy link
Contributor

I'd like to create two JS bundles one with esnext->ES5 via babel-preset-env (IE11) and one linking to a config esnext->escurrent-ish via babel-preset-env(chrome 54, firefox 51).

I'd like to be able to switch between them somehow, eg feature detection in the HTML or something in the server. I think this is a bit of a pain with html-webpack-plugin (not sure though).

Most of our customers are on Chrome >= 54, so we don't mind slowing the site down a bit for those users running ES5.

@graingert graingert changed the title working with multiple compilations/configs tutorial on working with multiple compilations/configs Jan 23, 2017
@jantimon
Copy link
Owner

You could write a plugin which does that using the html-webpack-plugin-alter-asset-tags event.

@graingert
Copy link
Contributor Author

for server side switching it's easy: just two configs with different build directories eg: "build/es5", "build/escurrent-ish"

@graingert
Copy link
Contributor Author

graingert commented Sep 11, 2017

closing in favor of #782 because chrome 61 / safari 10.2 supports JS feature detection with type=module / nomodule

@lock
Copy link

lock bot commented May 31, 2018

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants