Skip to content

Commit

Permalink
chore: preserve dynamic import for remix-serve (#7173)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-ebey authored Aug 15, 2023
1 parent ae92f57 commit c114621
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/v2-serve-dynamic-import.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/serve": major
---

Preserve dynamic imports in remix-serve for external bundle
11 changes: 11 additions & 0 deletions packages/remix-serve/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ module.exports = function rollup() {
extensions: [".ts", ".tsx"],
}),
nodeResolve({ extensions: [".ts", ".tsx"] }),
// Allow dynamic imports in CJS code to allow us to utilize
// ESM modules as part of the compiler.
{
name: "dynamic-import-polyfill",
renderDynamicImport() {
return {
left: "import(",
right: ")",
};
},
},
copy({
targets: [
{ src: "LICENSE.md", dest: [outputDir, sourceDir] },
Expand Down

0 comments on commit c114621

Please sign in to comment.