-
Notifications
You must be signed in to change notification settings - Fork 66
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
Build it #3
Comments
Posting the notes from building with r.js so far: Problem: Bug: Bug: Bug: Bug: built file loaded in Bug: Output sourcemap for |
working build in https://github.com/matt-gadd/examples/tree/build-using-rjs |
Okay I now have a working Webpack build at: https://github.com/matt-gadd/examples/tree/build-webpack The Webpack build drops the need for grunt in todo-mvc, the TS is compiled via ts-loader in Webpack, any resources are copied via Webpack also. Unfortunately their were a fair few hoops to jump through due to how we currently ship our dependencies: Bug: Webpack does not understand the TS UMD wrapper at all. This results in Webpack not being able to deduce any of the dependencies even when forcing Workaround: Had to write a nasty AST mangler to trick Webpack into resolving the deps. https://github.com/matt-gadd/umd-compat-webpack-plugin/blob/master/index.js. This causes some other minor issues further down the line (we end up having to stub a Bug: Webpack generates built files with syntax errors for AMD style dynamic requires it can't resolve: webpack/webpack#920. In our case blows up at https://github.com/dojo/core/blob/master/src/load.ts#L57. Workaround: Turn off evaluation of dynamic require expressions. Problem: Because we need to alias our deps to the Workaround: Problem: Sourcemap remapping for libs are supported by the source-map-loader plugin (equivalent to sorcery that I used for rjs). Maquette with its slightly broken sourcemap blows it up. Workaround: For now, limit to the dojo deps only. Bug: Sourcemap source filepaths are messed up for dependencies. Overall I think this shows up the limitations of shipping UMD. The commonjs side of things is not ideal as the shape of the actual package is not commonjs like making it difficult to consume out the box. For all the issues that we have with Webpack and UMD I imagine other tooling like rollup (and it's transformer for cjs to imports) will have the same issues. Given the issues, we should at least seriously consider shipping a proper commonjs style package - that way Webpack et al will work without any configuration or hacks. Finally, we need to seriously consider making a decision on what we tooling officially support and recommend, this may impact our work on say |
Did you do any research into ESM and WebPack? Would that be a better "final" format for bundling? Yes, I agree that we should publish a shape of a package just for CJS. I think it is the only way we will get around the challenges of not being able to re-root CJS easily and if we output the |
@kitsonk WebPack 2.0, which is still in beta has support for ESM (although i'm unsure of how well it sticks to the spec, statements like |
Naw, less adventure, more productivity (maybe). |
@matt-gadd status is still in-prog? |
@rishson I think we can close this. |
We should be able to production-ify our Todo-MVC application
The text was updated successfully, but these errors were encountered: