Skip to content

Commit

Permalink
Default to output native modules. Add outputSystemJS option.
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldenning committed Sep 30, 2024
1 parent 2d97c0e commit 05f9459
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gentle-ducks-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-config-single-spa": major
---

Output to native ES modules by default. Add new outputSystemJS option
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function webpackConfigSingleSpa(opts) {
),
output: {
filename: `${opts.orgName}-${opts.projectName}.js`,
libraryTarget: "system",
libraryTarget: opts.outputSystemJS ? "system" : "module",
path: path.resolve(process.cwd(), "dist"),
uniqueName: opts.projectName,
devtoolNamespace: `${opts.projectName}`,
Expand Down Expand Up @@ -142,5 +142,8 @@ function webpackConfigSingleSpa(opts) {
resolve: {
extensions: [".mjs", ".js", ".jsx", ".wasm", ".json"],
},
experiments: {
outputModule: !opts.outputSystemJS,
},
};
}
13 changes: 13 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 05f9459

Please sign in to comment.