Skip to content

Commit

Permalink
Support for import-map-externals plugin (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldenning authored Oct 2, 2024
1 parent f9edeef commit 5e19bc1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/young-eagles-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-config-single-spa": minor
---

Support for importMapUrl option, via import-map-externals-webpack-plugin
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const _HtmlWebpackPlugin = require("html-webpack-plugin");
const StandaloneSingleSpaPlugin = require("standalone-single-spa-webpack-plugin");
const SystemJSPublicPathPlugin = require("systemjs-webpack-interop/SystemJSPublicPathWebpackPlugin");
const {
ImportMapExternalsPlugin,
} = require("import-map-externals-webpack-plugin");

module.exports = webpackConfigSingleSpa;

Expand Down Expand Up @@ -138,6 +141,10 @@ function webpackConfigSingleSpa(opts) {
HtmlWebpackPlugin,
...opts.standaloneOptions,
}),
opts.importMapUrl &&
new ImportMapExternalsPlugin({
importMapUrl: opts.importMapUrl,
}),
].filter(Boolean),
resolve: {
extensions: [".mjs", ".js", ".jsx", ".wasm", ".json"],
Expand Down
1 change: 1 addition & 0 deletions packages/webpack-config-single-spa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"babel-loader": "^8.2.5",
"css-loader": "^6.8.1",
"html-webpack-plugin": "^5.5.4",
"import-map-externals-webpack-plugin": "^1.0.0",
"standalone-single-spa-webpack-plugin": "^4.0.0",
"style-loader": "^3.2.1",
"systemjs-webpack-interop": "^2.3.7",
Expand Down
8 changes: 8 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 5e19bc1

Please sign in to comment.