-
Notifications
You must be signed in to change notification settings - Fork 32
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
Compile legacy and modern builds in a single pass #395
Comments
Did a bit of a POC on this. You can see it here, https://differential-loading.now.sh/#home If you view the source you can see that theres a few new bits in that HTML. Specifically a reference to both ChangesThis build required several changes. cli-build-appChanges can be seen here.
webpack-contribChanges can be seen here. Added a "legacy" option to the build time render plugin, which controls whether or not the plugin uses modern or legacy build files. Build time legacy Problems
|
OK! Attempt 2. POC: https://differential-loading-poc.rorticus.now.sh/#home This approach differs from the last in that instead of using two separate webpack builds, there is only one build. A plugin creates a child compiler to output the modern version. This causes two sets of files to be created:
ChangesChanges to cli-buid-app
webpack-contrib
Problems
|
I've picked up where Rory left off with the second approach. I was able to get source maps working by just applying a fix made for them since the original effort to the modified version of the plugin. The next thing I've been working on is getting externals working, as the original plugin does not support them. Right now I've updated the plugin to apply the externals plugin and it now processes our externals config, but scripts are still not being injected in index.html. Update: The scripts were not being injected because they were being removed by the |
I reworked the babel esm plugin to be a generalized "additional compile" plugin. The results so far seem promising and doesn't force us into using babel. I also updated the API to allow changing loader options as well as adding/removing loaders which enables most of the other legacy vs non legacy differences. There's still some issues to track down like arrow functions appearing in legacy code now. Changes to webpack-contrib and clil-build-app can be seen here and here |
Instead of building two separate bundles in two separate builds, one legacy and one modern, we should create both bundles in the same build.
The text was updated successfully, but these errors were encountered: