Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: set AMD module module names within UMD bundles
Currently if the UMD bundles from `@material/<..>` NPM modules are loaded in the browser, using RequireJS or other loaders, the AMD modules would need to be named manually using a loader configuration. e.g. ```js require.config({ paths: { '@material/animation': '/base/npm/node_modules/@material/animation/dist/mdc.animation', ... } } ``` This could be avoided if the AMD `define` invocations in the UMD file would specify a module id, similar to how it's done in packages of the Angular organization. This allows for easier consumption in tests as well. Note that this change causes a breaking change for the UMD-case where the exports are bound to a global variable. Previously the entry-point would appear in camel-case, but now it's matching the actual package name in dash-case. This is unfortunately not avoidable with the current Webpack tooling. i.e. previous UMD users relying on the globals (which are rather rare anyway), would need to switch from `window.mdc.circularProgress` to `window.mdc['circular-progress]`.
- Loading branch information
1 parent
22d29cb
commit c0e7353
Showing
2 changed files
with
63 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters