Skip to content

Commit

Permalink
fix(infrastructure): add the es5 @material/package/dist/mdc.package t…
Browse files Browse the repository at this point in the history
…o externals (#223)
  • Loading branch information
Matt Goo authored Aug 16, 2018
1 parent e10b3ec commit 73fb45b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function getCommonWebpackParams(entryPath, chunk, {isCss, modules}) {
}

function getMaterialExternals() {
const dashedToCamel = (name) => name.replace(/-(\w)/g, (_, v) => v.toUpperCase());
const externals = {};
[
'base',
Expand All @@ -86,7 +87,12 @@ function getMaterialExternals() {
'textfield',
'top-app-bar',
'typography',
].forEach((name) => externals[`@material/${name}`] = `@material/${name}`);
].forEach((name) => {
// this can be reverted when we change back to @material/foo-package-filename
// https://github.com/material-components/material-components-web/pull/3245
const fileName = `@material/${name}/dist/mdc.${dashedToCamel(name)}`;
externals[fileName] = fileName;
});
return externals;
}

Expand Down

0 comments on commit 73fb45b

Please sign in to comment.