Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit 73fb45b

Browse files
author
Matt Goo
authored
fix(infrastructure): add the es5 @material/package/dist/mdc.package to externals (#223)
1 parent e10b3ec commit 73fb45b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/webpack.config.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ function getCommonWebpackParams(entryPath, chunk, {isCss, modules}) {
6969
}
7070

7171
function getMaterialExternals() {
72+
const dashedToCamel = (name) => name.replace(/-(\w)/g, (_, v) => v.toUpperCase());
7273
const externals = {};
7374
[
7475
'base',
@@ -86,7 +87,12 @@ function getMaterialExternals() {
8687
'textfield',
8788
'top-app-bar',
8889
'typography',
89-
].forEach((name) => externals[`@material/${name}`] = `@material/${name}`);
90+
].forEach((name) => {
91+
// this can be reverted when we change back to @material/foo-package-filename
92+
// https://github.com/material-components/material-components-web/pull/3245
93+
const fileName = `@material/${name}/dist/mdc.${dashedToCamel(name)}`;
94+
externals[fileName] = fileName;
95+
});
9096
return externals;
9197
}
9298

0 commit comments

Comments
 (0)