Skip to content

Commit b5bf64a

Browse files
committed
Inline music-metadata lazy loads to fix builds
1 parent 1ba58c8 commit b5bf64a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/webamp/scripts/rollup.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ const BUNDLES = [
4444
file: "built/webamp.bundle.js",
4545
format: "umd",
4646
name: "Webamp",
47+
// music-metadata uses dynamic imports, so we need to inline them
48+
// to avoid issues with the UMD build.
49+
inlineDynamicImports: true,
4750
},
4851
},
4952
{
@@ -54,6 +57,9 @@ const BUNDLES = [
5457
file: "built/webamp.bundle.min.js",
5558
format: "umd",
5659
name: "Webamp",
60+
// music-metadata uses dynamic imports, so we need to inline them
61+
// to avoid issues with the UMD build.
62+
inlineDynamicImports: true,
5763
},
5864
},
5965
{
@@ -63,6 +69,9 @@ const BUNDLES = [
6369
output: {
6470
file: "built/webamp.bundle.min.mjs",
6571
format: "module",
72+
// music-metadata uses dynamic imports, so we need to inline them
73+
// to avoid issues with the UMD build.
74+
inlineDynamicImports: true,
6675
},
6776
},
6877
];

packages/webamp/scripts/rollupPlugins.mjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ export function getPlugins({ minify, outputFile, vite }) {
2323
// https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency
2424
// TODO: We could offer a version which does not inline React/React-DOM
2525
nodeResolve(),
26-
// Needed for music-metadata-browser in the Webamp bundle which depends upon
27-
// being able to use some polyfillable node APIs
28-
nodePolyfills(),
2926
typescript({
3027
compilerOptions: {
3128
jsx: "react-jsx",

0 commit comments

Comments
 (0)