From 2dd13d0b1b2aa612116dc4579de9975a50d9d7a3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:59:00 +0000 Subject: [PATCH] deploy: c02e5ba6ea144b872c7ed3312f596a516d0c1028 --- 404.html | 2 +- assets/js/e5846443.b6b23426.js | 1 - assets/js/e5846443.e129337c.js | 1 + .../js/{runtime~main.7ef0dfe4.js => runtime~main.807b7bb4.js} | 2 +- blog/2016/02/26/a-case-for-soa-in-the-browser/index.html | 2 +- blog/2016/12/16/a-step-by-step-guide-to-single-spa/index.html | 2 +- blog/2018/06/19/single-spa-parcels-explained/index.html | 2 +- blog/2019/02/20/single-spa-inspector/index.html | 2 +- blog/2020/02/24/single-spa-5/index.html | 2 +- blog/2023/08/22/single-spa-core-is-expanding/index.html | 2 +- .../introducing-single-spa-new-core-team-members/index.html | 2 +- blog/2023/11/07/core-team-meeting-notes/index.html | 2 +- blog/2023/11/27/single-spa-6/index.html | 2 +- blog/2023/12/12/core-team-meeting-notes/index.html | 2 +- blog/2024/01/03/core-team-meeting-notes/index.html | 2 +- blog/2024/02/14/core-team-meeting-notes/index.html | 2 +- blog/archive/index.html | 2 +- blog/index.html | 2 +- blog/page/2/index.html | 2 +- contributors/index.html | 2 +- docs/4.x/api/index.html | 2 +- docs/4.x/building-applications/index.html | 2 +- docs/4.x/code-of-conduct/index.html | 2 +- docs/4.x/configuration/index.html | 2 +- docs/4.x/contributing-overview/index.html | 2 +- docs/4.x/ecosystem-angular/index.html | 2 +- docs/4.x/ecosystem-angularjs/index.html | 2 +- docs/4.x/ecosystem-backbone/index.html | 2 +- docs/4.x/ecosystem-cycle/index.html | 2 +- docs/4.x/ecosystem-ember/index.html | 2 +- docs/4.x/ecosystem-html-web-components/index.html | 2 +- docs/4.x/ecosystem-inferno/index.html | 2 +- docs/4.x/ecosystem-leaked-globals/index.html | 2 +- docs/4.x/ecosystem-preact/index.html | 2 +- docs/4.x/ecosystem-react/index.html | 2 +- docs/4.x/ecosystem-riot/index.html | 2 +- docs/4.x/ecosystem-svelte/index.html | 2 +- docs/4.x/ecosystem-vue/index.html | 2 +- docs/4.x/ecosystem/index.html | 2 +- docs/4.x/examples/index.html | 2 +- docs/4.x/faq/index.html | 2 +- docs/4.x/getting-started-overview/index.html | 2 +- docs/4.x/glossary/index.html | 2 +- docs/4.x/migrating-angularJS-tutorial/index.html | 2 +- docs/4.x/migrating-existing-spas/index.html | 2 +- docs/4.x/migrating-react-tutorial/index.html | 2 +- docs/4.x/parcels-api/index.html | 2 +- docs/4.x/parcels-overview/index.html | 2 +- docs/4.x/separating-applications/index.html | 2 +- docs/4.x/starting-from-scratch/index.html | 2 +- docs/5.x/api/index.html | 2 +- docs/5.x/building-applications/index.html | 2 +- docs/5.x/code-of-conduct/index.html | 2 +- docs/5.x/configuration/index.html | 2 +- docs/5.x/contributing-overview/index.html | 2 +- docs/5.x/create-single-spa/index.html | 2 +- docs/5.x/devtools/index.html | 2 +- docs/5.x/ecosystem-alpinejs/index.html | 2 +- docs/5.x/ecosystem-angular/index.html | 2 +- docs/5.x/ecosystem-angularjs/index.html | 2 +- docs/5.x/ecosystem-backbone/index.html | 2 +- docs/5.x/ecosystem-css/index.html | 2 +- docs/5.x/ecosystem-cycle/index.html | 2 +- docs/5.x/ecosystem-dojo/index.html | 2 +- docs/5.x/ecosystem-ember/index.html | 2 +- docs/5.x/ecosystem-html-web-components/index.html | 2 +- docs/5.x/ecosystem-inferno/index.html | 2 +- docs/5.x/ecosystem-leaked-globals/index.html | 2 +- docs/5.x/ecosystem-preact/index.html | 2 +- docs/5.x/ecosystem-react/index.html | 2 +- docs/5.x/ecosystem-riot/index.html | 2 +- docs/5.x/ecosystem-snowpack/index.html | 2 +- docs/5.x/ecosystem-svelte/index.html | 2 +- docs/5.x/ecosystem-vite/index.html | 2 +- docs/5.x/ecosystem-vue/index.html | 2 +- docs/5.x/ecosystem/index.html | 2 +- docs/5.x/examples/index.html | 2 +- docs/5.x/faq/index.html | 2 +- docs/5.x/getting-started-overview/index.html | 2 +- docs/5.x/glossary/index.html | 2 +- docs/5.x/layout-api/index.html | 2 +- docs/5.x/layout-definition/index.html | 2 +- docs/5.x/layout-overview/index.html | 2 +- docs/5.x/microfrontends-concept/index.html | 2 +- docs/5.x/migrating-existing-spas/index.html | 2 +- docs/5.x/module-types/index.html | 2 +- docs/5.x/parcels-api/index.html | 2 +- docs/5.x/parcels-overview/index.html | 2 +- docs/5.x/recommended-setup/index.html | 2 +- docs/5.x/separating-applications/index.html | 2 +- docs/5.x/shared-webpack-configs/index.html | 2 +- docs/5.x/single-spa-playground/index.html | 2 +- docs/5.x/ssr-overview/index.html | 2 +- docs/5.x/testing/e2e/index.html | 2 +- docs/5.x/testing/units/index.html | 2 +- docs/5.x/videos/index.html | 2 +- docs/api/index.html | 2 +- docs/building-applications/index.html | 2 +- docs/code-of-conduct/index.html | 2 +- docs/configuration/index.html | 2 +- docs/contributing-overview/index.html | 2 +- docs/create-single-spa/index.html | 2 +- docs/devtools/index.html | 2 +- docs/ecosystem-alpinejs/index.html | 2 +- docs/ecosystem-angular/index.html | 2 +- docs/ecosystem-angularjs/index.html | 2 +- docs/ecosystem-backbone/index.html | 2 +- docs/ecosystem-css/index.html | 2 +- docs/ecosystem-cycle/index.html | 2 +- docs/ecosystem-dojo/index.html | 2 +- docs/ecosystem-ember/index.html | 2 +- docs/ecosystem-html-web-components/index.html | 2 +- docs/ecosystem-inferno/index.html | 2 +- docs/ecosystem-leaked-globals/index.html | 2 +- docs/ecosystem-preact/index.html | 2 +- docs/ecosystem-react/index.html | 2 +- docs/ecosystem-riot/index.html | 2 +- docs/ecosystem-snowpack/index.html | 2 +- docs/ecosystem-svelte/index.html | 2 +- docs/ecosystem-vite/index.html | 2 +- docs/ecosystem-vue/index.html | 2 +- docs/ecosystem/index.html | 2 +- docs/examples/index.html | 2 +- docs/faq/index.html | 2 +- docs/getting-started-overview/index.html | 2 +- docs/glossary/index.html | 2 +- docs/index.html | 2 +- docs/layout-api/index.html | 2 +- docs/layout-definition/index.html | 2 +- docs/layout-overview/index.html | 2 +- docs/microfrontends-concept/index.html | 2 +- docs/migrating-existing-spas/index.html | 2 +- docs/module-types/index.html | 2 +- docs/next/index.html | 2 +- docs/parcels-api/index.html | 2 +- docs/parcels-overview/index.html | 2 +- docs/recommended-setup/index.html | 2 +- docs/separating-applications/index.html | 2 +- docs/shared-webpack-configs/index.html | 4 ++-- docs/single-spa-playground/index.html | 2 +- docs/ssr-overview/index.html | 2 +- docs/testing/e2e/index.html | 2 +- docs/testing/units/index.html | 2 +- docs/videos/index.html | 2 +- error/index.html | 2 +- help/index.html | 2 +- index.html | 2 +- languages/index.html | 2 +- privacy/single-spa-inspector-privacy-policy/index.html | 2 +- search/index.html | 2 +- sponsors/index.html | 2 +- users/index.html | 2 +- versions/index.html | 2 +- 153 files changed, 153 insertions(+), 153 deletions(-) delete mode 100644 assets/js/e5846443.b6b23426.js create mode 100644 assets/js/e5846443.e129337c.js rename assets/js/{runtime~main.7ef0dfe4.js => runtime~main.807b7bb4.js} (99%) diff --git a/404.html b/404.html index 348418a52..de25ee514 100644 --- a/404.html +++ b/404.html @@ -14,7 +14,7 @@ - +
diff --git a/assets/js/e5846443.b6b23426.js b/assets/js/e5846443.b6b23426.js deleted file mode 100644 index 09b96b28f..000000000 --- a/assets/js/e5846443.b6b23426.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[7036],{8045:(e,n,a)=>{a.r(n),a.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>g,frontMatter:()=>t,metadata:()=>c,toc:()=>l});var s=a(4848),i=a(8453);const t={title:"Shared Webpack configs"},o=void 0,c={id:"shared-webpack-configs",title:"Shared Webpack configs",description:"single-spa also publishes a few shared Webpack config packages that include basics needed for creating single-spa applications. These configs are used by applications generated with create-single-spa, and can be used as a starting point to extend/modify a custom configuration for your organization/team.",source:"@site/versioned_docs/version-6.x/shared-webpack-configs.md",sourceDirName:".",slug:"/shared-webpack-configs",permalink:"/docs/shared-webpack-configs",draft:!1,unlisted:!1,editUrl:"https://github.com/single-spa/single-spa.js.org/blob/master/website/versioned_docs/version-6.x/shared-webpack-configs.md",tags:[],version:"6.x",frontMatter:{title:"Shared Webpack configs"},sidebar:"docs",previous:{title:"create-single-spa",permalink:"/docs/create-single-spa"},next:{title:"Overview",permalink:"/docs/microfrontends-concept"}},r={},l=[{value:"webpack-config-single-spa",id:"webpack-config-single-spa",level:2},{value:"Installation",id:"installation",level:3},{value:"Usage",id:"usage",level:3},{value:"webpack-config-single-spa-react",id:"webpack-config-single-spa-react",level:2},{value:"Installation",id:"installation-1",level:3},{value:"Usage",id:"usage-1",level:3},{value:"webpack-config-single-spa-ts",id:"webpack-config-single-spa-ts",level:2},{value:"Installation",id:"installation-2",level:3},{value:"Usage",id:"usage-2",level:3},{value:"webpack-config-single-spa-react-ts",id:"webpack-config-single-spa-react-ts",level:2},{value:"Installation",id:"installation-3",level:3},{value:"Usage",id:"usage-3",level:3},{value:"Custom Webpack configuration",id:"custom-webpack-configuration",level:2},{value:"Example: load SVGs as components",id:"example-load-svgs-as-components",level:4},{value:"Replacing plugins",id:"replacing-plugins",level:3},{value:"Example: replace HtmlWebpackPlugin instance",id:"example-replace-htmlwebpackplugin-instance",level:4}];function p(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["single-spa also publishes a few shared Webpack config packages that include basics needed for creating single-spa applications. These configs are used by applications generated with ",(0,s.jsx)(n.a,{href:"/docs/create-single-spa",children:"create-single-spa"}),", and can be used as a starting point to extend/modify a custom configuration for your organization/team."]}),"\n",(0,s.jsxs)(n.p,{children:["These packages are housed within the ",(0,s.jsx)(n.a,{href:"https://github.com/single-spa/create-single-spa/tree/main/packages",children:"create-single-spa repository"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"webpack-config-single-spa",children:"webpack-config-single-spa"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/single-spa/create-single-spa/tree/master/packages/webpack-config-single-spa",children:"Github project"})}),"\n",(0,s.jsx)(n.p,{children:"A shareable, customizable webpack config that is used for single-spa modules."}),"\n",(0,s.jsx)(n.h3,{id:"installation",children:"Installation"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"npm install --save-dev webpack-config-single-spa webpack-merge\n\n# or\nyarn add --dev webpack-config-single-spa webpack-merge\n"})}),"\n",(0,s.jsx)(n.h3,{id:"usage",children:"Usage"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'const singleSpaDefaults = require("webpack-config-single-spa");\nconst { merge } = require("webpack-merge"); // webpack-merge@5.0.3+\n\nmodule.exports = (webpackConfigEnv, argv) => {\n const defaultConfig = singleSpaDefaults({\n // The name of the organization this application is written for\n orgName: "name-of-company",\n // The name of the current project. This usually matches the git repo\'s name\n projectName: "name-of-project",\n // See https://webpack.js.org/guides/environment-variables/#root for explanation of webpackConfigEnv\n webpackConfigEnv,\n // The CLI commands in the package.json script that triggered this build\n argv,\n // optional\n // This changes whether package names that start with @your-org-name are\n // treated as webpack externals or not. Defaults to true\n orgPackagesAsExternal: true,\n\n // optional, defaults to 1\n // This is the rootDirectoryLevel that is passed to https://github.com/joeldenning/systemjs-webpack-interop\n rootDirectoryLevel: 1,\n\n // optional, defaults to false\n // Disable html-webpack-plugin (and standalone-single-spa-webpack-plugin) entirely\n // This is intended for root configs, but can be used in other cases, too\n disableHtmlGeneration: false,\n });\n\n return merge(defaultConfig, {\n // modify the webpack config however you\'d like to by adding to this object\n });\n};\n'})}),"\n",(0,s.jsx)(n.h2,{id:"webpack-config-single-spa-react",children:"webpack-config-single-spa-react"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/single-spa/create-single-spa/tree/master/packages/webpack-config-single-spa-react",children:"Github project"})}),"\n",(0,s.jsxs)(n.p,{children:["A shareable, customizable webpack config that adds react-specific configuration to ",(0,s.jsx)(n.code,{children:"webpack-config-single-spa"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"installation-1",children:"Installation"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"npm install --save-dev webpack-config-single-spa-react webpack-merge\n\n# or\nyarn add --dev webpack-config-single-spa-react webpack-merge\n"})}),"\n",(0,s.jsx)(n.h3,{id:"usage-1",children:"Usage"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const singleSpaDefaults = require('webpack-config-single-spa-react');\nconst webpackMerge = require('webpack-merge');\n\nmodule.exports = (webpackConfigEnv, argv) => {\n const defaultConfig = singleSpaDefaults({\n // The name of the organization this application is written for\n orgName: 'name-of-company',\n // The name of the current project. This usually matches the git repo's name\n projectName: 'name-of-project',\n // See https://webpack.js.org/guides/environment-variables/#root for explanation of webpackConfigEnv\n webpackConfigEnv,\n // The CLI commands in the package.json script that triggered this build\n argv,\n // optional\n // This changes whether package names that start with @your-org-name are\n // treated as webpack externals or not. Defaults to true\n orgPackagesAsExternal: true,\n\n // optional, defaults to 1\n // This is the rootDirectoryLevel that is passed to https://github.com/joeldenning/systemjs-webpack-interop\n rootDirectoryLevel: 1,\n\n // optional, defaults to {}\n // This controls the options given to standalone-single-spa-webpack-plugin\n // See https://github.com/single-spa/standalone-single-spa-webpack-plugin#usage\n standaloneOptions: {},\n });\n\n // modify the webpack config however you'd like to by adding to this object\n });\n};\n"})}),"\n",(0,s.jsx)(n.h2,{id:"webpack-config-single-spa-ts",children:"webpack-config-single-spa-ts"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/single-spa/create-single-spa/tree/master/packages/webpack-config-single-spa-ts",children:"Github project"})}),"\n",(0,s.jsxs)(n.p,{children:["A shareable, customizable webpack config that adds typescript-specific configuration to ",(0,s.jsx)(n.code,{children:"webpack-config-single-spa"}),". Note that webpack-config-single-spa-ts has a peerDependency on ",(0,s.jsx)(n.code,{children:"typescript"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"installation-2",children:"Installation"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"npm install --save-dev webpack-config-single-spa-ts webpack-merge\n\n# or\nyarn add --dev webpack-config-single-spa-ts webpack-merge\n"})}),"\n",(0,s.jsx)(n.h3,{id:"usage-2",children:"Usage"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'const webpackMerge = require("webpack-merge");\nconst singleSpaDefaults = require("webpack-config-single-spa-ts");\n\nmodule.exports = (webpackConfigEnv, argv) => {\n const defaultConfig = singleSpaDefaults({\n // The name of the organization this application is written for\n orgName: "name-of-company",\n // The name of the current project. This usually matches the git repo\'s name\n projectName: "name-of-project",\n // See https://webpack.js.org/guides/environment-variables/#root for explanation of webpackConfigEnv\n webpackConfigEnv,\n // The CLI commands in the package.json script that triggered this build\n argv,\n });\n\n return webpackMerge.smart(defaultConfig, {\n // modify the webpack config however you\'d like to by adding to this object\n });\n};\n'})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'const singleSpaTs = require("webpack-config-single-spa-ts");\n\n// Alternatively, you may modify a webpack config directly\nconst myOtherWebpackConfig = {\n /* ... */\n};\nconst finalConfig = singleSpaDefaults.modifyConfig(myOtherWebpackConfig);\n'})}),"\n",(0,s.jsx)(n.h2,{id:"webpack-config-single-spa-react-ts",children:"webpack-config-single-spa-react-ts"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/single-spa/create-single-spa/tree/master/packages/webpack-config-single-spa-react-ts",children:"Github project"})}),"\n",(0,s.jsx)(n.p,{children:"A shareable, customizable webpack config that creates a webpack config that works with both react and typescript. Note that webpack-config-single-spa-react-ts simply merges the config from webpack-config-single-spa-react with that of webpack-config-single-spa-ts."}),"\n",(0,s.jsx)(n.h3,{id:"installation-3",children:"Installation"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"npm install --save-dev webpack-config-single-spa-react-ts webpack-merge\n\n# or\nyarn add --dev webpack-config-single-spa-react-ts webpack-merge\n"})}),"\n",(0,s.jsx)(n.h3,{id:"usage-3",children:"Usage"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'const webpackMerge = require("webpack-merge");\nconst singleSpaDefaults = require("webpack-config-single-spa-react-ts");\n\nmodule.exports = (webpackConfigEnv, argv) => {\n const defaultConfig = singleSpaDefaults({\n // The name of the organization this application is written for\n orgName: "name-of-company",\n\n // The name of the current project. This usually matches the git repo\'s name\n projectName: "name-of-project",\n\n // optional\n // This changes whether package names that start with @your-org-name are\n // treated as webpack externals or not. Defaults to true\n orgPackagesAsExternal: true,\n\n // See https://webpack.js.org/guides/environment-variables/#root for explanation of webpackConfigEnv\n webpackConfigEnv,\n\n // The CLI commands in the package.json script that triggered this build\n argv,\n\n // optional, defaults to 1\n // This is the rootDirectoryLevel that is passed to https://github.com/joeldenning/systemjs-webpack-interop\n rootDirectoryLevel: 1,\n\n // optional, defaults to false.\n // When true, this removes html-webpack-plugin and standalone-single-spa-webpack-plugin\n disableHtmlGeneration: false,\n });\n\n return webpackMerge.smart(defaultConfig, {\n // modify the webpack config however you\'d like to by adding to this object\n });\n};\n'})}),"\n",(0,s.jsx)(n.h2,{id:"custom-webpack-configuration",children:"Custom Webpack configuration"}),"\n",(0,s.jsxs)(n.p,{children:["Our shared Webpack configs are intended to be extensible to fit the requirements of your applications. These custom config options can be made in each project's ",(0,s.jsx)(n.code,{children:"webpack.config.js"})," file generated by create-single-spa, or used as the basis for a tailored shared config for your organization."]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Use ",(0,s.jsx)(n.code,{children:"require.resolve"})," to reuse loaders that are included as dependencies","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"this is especially useful for reusing any of webpack-config-single-spa-*'s dependencies"}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["webpack-merge ",(0,s.jsx)(n.a,{href:"https://github.com/survivejs/webpack-merge#limitations",children:"does not support merging configs exported as a function"}),", which may be relevant if creating shared config packages. webpack-config-single-spa-* configs require ",(0,s.jsx)(n.code,{children:"webpackConfigEnv"})," and ",(0,s.jsx)(n.code,{children:"argv"})," parameters which necesitates ",(0,s.jsx)(n.a,{href:"https://webpack.js.org/configuration/configuration-types/#exporting-a-function",children:"exporting a config function"})," but return a plain object. This makes it compatible with webpack-merge."]}),"\n",(0,s.jsxs)(n.li,{children:["Use webpack-merge's ",(0,s.jsx)(n.a,{href:"https://github.com/survivejs/webpack-merge#mergewithrules",children:(0,s.jsx)(n.code,{children:"mergeWithRules"})})," function to merge and de-duplicate ",(0,s.jsx)(n.a,{href:"https://webpack.js.org/configuration/module/#modulerules",children:"webpack rules"})]}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"example-load-svgs-as-components",children:"Example: load SVGs as components"}),"\n",(0,s.jsxs)(n.p,{children:["You must also install ",(0,s.jsx)(n.a,{href:"https://www.npmjs.com/package/@svgr/webpack",children:"@svgr/webpack"}),"."]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsx)(n.p,{children:"Available in webpack-config-single-spa@5.3.0+"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'const singleSpaDefaults = require("webpack-config-single-spa");\nconst { mergeWithRules } = require("webpack-merge");\n\nconst merge = mergeWithRules({\n module: {\n rules: {\n // replace the entire `rule` if the `test` property matches\n test: "match",\n use: "replace",\n },\n },\n});\n\nmodule.exports = (env, argv) => {\n const defaultConfig = singleSpaDefaults({\n orgName: "abcde",\n projectName: "fghij",\n webpackConfigEnv: env,\n argv,\n });\n\n const config = merge(defaultConfig, {\n module: {\n rules: [\n {\n test: /\\.svg$/i,\n use: [{ loader: "@svgr/webpack" }],\n },\n ],\n },\n });\n\n // console.dir(config, null, 2) // useful for debugging\n return config;\n};\n'})}),"\n",(0,s.jsx)(n.h3,{id:"replacing-plugins",children:"Replacing plugins"}),"\n",(0,s.jsxs)(n.p,{children:["Use webpack-merge's ",(0,s.jsx)(n.a,{href:"https://github.com/survivejs/webpack-merge#mergewithcustomize-customizearray-customizeobject-configuration--configuration",children:(0,s.jsx)(n.code,{children:"mergeWithCustomize"})})," to resolve duplicate plugins or replace instances. Duplicate plugins often result in cryptic errors!"]}),"\n",(0,s.jsxs)(n.p,{children:["When referencing a loader that is installed as a dependency of webpack-config-single-spa, use ",(0,s.jsx)(n.a,{href:"https://nodejs.org/api/modules.html#modules_require_resolve_request_options",children:"require.resolve"})," to ensure its path is resolved correctly."]}),"\n",(0,s.jsx)(n.h4,{id:"example-replace-htmlwebpackplugin-instance",children:"Example: replace HtmlWebpackPlugin instance"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'const { mergeWithCustomize, unique } = require("webpack-merge");\nconst singleSpaDefaults = require("webpack-config-single-spa");\nconst HtmlWebpackPlugin = require("html-webpack-plugin");\n\nconst merge = mergeWithCustomize({\n customizeArray: unique(\n "plugins",\n ["HtmlWebpackPlugin"],\n (plugin) => plugin.constructor && plugin.constructor.name,\n ),\n});\n\nmodule.exports = (env, argv) => {\n const orgName = "example";\n const myEnv = process.env.NODE_ENV || "development";\n\n const defaultConfig = singleSpaDefaults({\n orgName,\n projectName: "custom-root-config",\n webpackConfigEnv: env,\n argv,\n });\n\n const config = merge(defaultConfig, {\n plugins: [\n new HtmlWebpackPlugin({\n inject: false,\n template: "src/custom.ejs",\n templateParameters: {\n isLocal: env?.isLocal,\n // additional templateParameters can now be supplied\n orgName,\n environment: myEnv,\n },\n }),\n ],\n });\n\n // console.dir(config, null, 2) // useful for debugging\n return config;\n};\n'})})]})}function g(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},8453:(e,n,a)=>{a.d(n,{R:()=>o,x:()=>c});var s=a(6540);const i={},t=s.createContext(i);function o(e){const n=s.useContext(t);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),s.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e5846443.e129337c.js b/assets/js/e5846443.e129337c.js new file mode 100644 index 000000000..81a14bd94 --- /dev/null +++ b/assets/js/e5846443.e129337c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[7036],{8045:(e,n,a)=>{a.r(n),a.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>g,frontMatter:()=>t,metadata:()=>c,toc:()=>l});var s=a(4848),i=a(8453);const t={title:"Shared Webpack configs"},o=void 0,c={id:"shared-webpack-configs",title:"Shared Webpack configs",description:"single-spa also publishes a few shared Webpack config packages that include basics needed for creating single-spa applications. These configs are used by applications generated with create-single-spa, and can be used as a starting point to extend/modify a custom configuration for your organization/team.",source:"@site/versioned_docs/version-6.x/shared-webpack-configs.md",sourceDirName:".",slug:"/shared-webpack-configs",permalink:"/docs/shared-webpack-configs",draft:!1,unlisted:!1,editUrl:"https://github.com/single-spa/single-spa.js.org/blob/master/website/versioned_docs/version-6.x/shared-webpack-configs.md",tags:[],version:"6.x",frontMatter:{title:"Shared Webpack configs"},sidebar:"docs",previous:{title:"create-single-spa",permalink:"/docs/create-single-spa"},next:{title:"Overview",permalink:"/docs/microfrontends-concept"}},r={},l=[{value:"webpack-config-single-spa",id:"webpack-config-single-spa",level:2},{value:"Installation",id:"installation",level:3},{value:"Usage",id:"usage",level:3},{value:"webpack-config-single-spa-react",id:"webpack-config-single-spa-react",level:2},{value:"Installation",id:"installation-1",level:3},{value:"Usage",id:"usage-1",level:3},{value:"webpack-config-single-spa-ts",id:"webpack-config-single-spa-ts",level:2},{value:"Installation",id:"installation-2",level:3},{value:"Usage",id:"usage-2",level:3},{value:"webpack-config-single-spa-react-ts",id:"webpack-config-single-spa-react-ts",level:2},{value:"Installation",id:"installation-3",level:3},{value:"Usage",id:"usage-3",level:3},{value:"Custom Webpack configuration",id:"custom-webpack-configuration",level:2},{value:"Example: load SVGs as components",id:"example-load-svgs-as-components",level:4},{value:"Replacing plugins",id:"replacing-plugins",level:3},{value:"Example: replace HtmlWebpackPlugin instance",id:"example-replace-htmlwebpackplugin-instance",level:4}];function p(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["single-spa also publishes a few shared Webpack config packages that include basics needed for creating single-spa applications. These configs are used by applications generated with ",(0,s.jsx)(n.a,{href:"/docs/create-single-spa",children:"create-single-spa"}),", and can be used as a starting point to extend/modify a custom configuration for your organization/team."]}),"\n",(0,s.jsxs)(n.p,{children:["These packages are housed within the ",(0,s.jsx)(n.a,{href:"https://github.com/single-spa/create-single-spa/tree/main/packages",children:"create-single-spa repository"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"webpack-config-single-spa",children:"webpack-config-single-spa"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/single-spa/create-single-spa/tree/master/packages/webpack-config-single-spa",children:"Github project"})}),"\n",(0,s.jsx)(n.p,{children:"A shareable, customizable webpack config that is used for single-spa modules."}),"\n",(0,s.jsx)(n.h3,{id:"installation",children:"Installation"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"npm install --save-dev webpack-config-single-spa webpack-merge\n\n# or\nyarn add --dev webpack-config-single-spa webpack-merge\n"})}),"\n",(0,s.jsx)(n.h3,{id:"usage",children:"Usage"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'const singleSpaDefaults = require("webpack-config-single-spa");\nconst { merge } = require("webpack-merge"); // webpack-merge@5.0.3+\n\nmodule.exports = (webpackConfigEnv, argv) => {\n const defaultConfig = singleSpaDefaults({\n // The name of the organization this application is written for\n orgName: "name-of-company",\n // The name of the current project. This usually matches the git repo\'s name\n projectName: "name-of-project",\n // See https://webpack.js.org/guides/environment-variables/#root for explanation of webpackConfigEnv\n webpackConfigEnv,\n // The CLI commands in the package.json script that triggered this build\n argv,\n // optional\n // This changes whether package names that start with @your-org-name are\n // treated as webpack externals or not. Defaults to true\n orgPackagesAsExternal: true,\n\n // optional, defaults to 1\n // This is the rootDirectoryLevel that is passed to https://github.com/joeldenning/systemjs-webpack-interop\n rootDirectoryLevel: 1,\n\n // optional, defaults to false\n // Disable html-webpack-plugin (and standalone-single-spa-webpack-plugin) entirely\n // This is intended for root configs, but can be used in other cases, too\n disableHtmlGeneration: false,\n });\n\n return merge(defaultConfig, {\n // modify the webpack config however you\'d like to by adding to this object\n });\n};\n'})}),"\n",(0,s.jsx)(n.h2,{id:"webpack-config-single-spa-react",children:"webpack-config-single-spa-react"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/single-spa/create-single-spa/tree/master/packages/webpack-config-single-spa-react",children:"Github project"})}),"\n",(0,s.jsxs)(n.p,{children:["A shareable, customizable webpack config that adds react-specific configuration to ",(0,s.jsx)(n.code,{children:"webpack-config-single-spa"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"installation-1",children:"Installation"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"npm install --save-dev webpack-config-single-spa-react webpack-merge\n\n# or\nyarn add --dev webpack-config-single-spa-react webpack-merge\n"})}),"\n",(0,s.jsx)(n.h3,{id:"usage-1",children:"Usage"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const singleSpaDefaults = require('webpack-config-single-spa-react');\nconst webpackMerge = require('webpack-merge');\n\nmodule.exports = (webpackConfigEnv, argv) => {\n const defaultConfig = singleSpaDefaults({\n // The name of the organization this application is written for\n orgName: 'name-of-company',\n // The name of the current project. This usually matches the git repo's name\n projectName: 'name-of-project',\n // See https://webpack.js.org/guides/environment-variables/#root for explanation of webpackConfigEnv\n webpackConfigEnv,\n // The CLI commands in the package.json script that triggered this build\n argv,\n // optional\n // This changes whether package names that start with @your-org-name are\n // treated as webpack externals or not. Defaults to true\n orgPackagesAsExternal: true,\n\n // optional, defaults to 1\n // This is the rootDirectoryLevel that is passed to https://github.com/joeldenning/systemjs-webpack-interop\n rootDirectoryLevel: 1,\n\n // optional, defaults to {}\n // This controls the options given to standalone-single-spa-webpack-plugin\n // See https://github.com/single-spa/standalone-single-spa-webpack-plugin#usage\n standaloneOptions: {},\n });\n\n return merge(defaultConfig, {\n // modify the webpack config however you'd like to by adding to this object\n });\n};\n"})}),"\n",(0,s.jsx)(n.h2,{id:"webpack-config-single-spa-ts",children:"webpack-config-single-spa-ts"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/single-spa/create-single-spa/tree/master/packages/webpack-config-single-spa-ts",children:"Github project"})}),"\n",(0,s.jsxs)(n.p,{children:["A shareable, customizable webpack config that adds typescript-specific configuration to ",(0,s.jsx)(n.code,{children:"webpack-config-single-spa"}),". Note that webpack-config-single-spa-ts has a peerDependency on ",(0,s.jsx)(n.code,{children:"typescript"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"installation-2",children:"Installation"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"npm install --save-dev webpack-config-single-spa-ts webpack-merge\n\n# or\nyarn add --dev webpack-config-single-spa-ts webpack-merge\n"})}),"\n",(0,s.jsx)(n.h3,{id:"usage-2",children:"Usage"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'const webpackMerge = require("webpack-merge");\nconst singleSpaDefaults = require("webpack-config-single-spa-ts");\n\nmodule.exports = (webpackConfigEnv, argv) => {\n const defaultConfig = singleSpaDefaults({\n // The name of the organization this application is written for\n orgName: "name-of-company",\n // The name of the current project. This usually matches the git repo\'s name\n projectName: "name-of-project",\n // See https://webpack.js.org/guides/environment-variables/#root for explanation of webpackConfigEnv\n webpackConfigEnv,\n // The CLI commands in the package.json script that triggered this build\n argv,\n });\n\n return webpackMerge.smart(defaultConfig, {\n // modify the webpack config however you\'d like to by adding to this object\n });\n};\n'})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'const singleSpaTs = require("webpack-config-single-spa-ts");\n\n// Alternatively, you may modify a webpack config directly\nconst myOtherWebpackConfig = {\n /* ... */\n};\nconst finalConfig = singleSpaDefaults.modifyConfig(myOtherWebpackConfig);\n'})}),"\n",(0,s.jsx)(n.h2,{id:"webpack-config-single-spa-react-ts",children:"webpack-config-single-spa-react-ts"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://github.com/single-spa/create-single-spa/tree/master/packages/webpack-config-single-spa-react-ts",children:"Github project"})}),"\n",(0,s.jsx)(n.p,{children:"A shareable, customizable webpack config that creates a webpack config that works with both react and typescript. Note that webpack-config-single-spa-react-ts simply merges the config from webpack-config-single-spa-react with that of webpack-config-single-spa-ts."}),"\n",(0,s.jsx)(n.h3,{id:"installation-3",children:"Installation"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"npm install --save-dev webpack-config-single-spa-react-ts webpack-merge\n\n# or\nyarn add --dev webpack-config-single-spa-react-ts webpack-merge\n"})}),"\n",(0,s.jsx)(n.h3,{id:"usage-3",children:"Usage"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'const webpackMerge = require("webpack-merge");\nconst singleSpaDefaults = require("webpack-config-single-spa-react-ts");\n\nmodule.exports = (webpackConfigEnv, argv) => {\n const defaultConfig = singleSpaDefaults({\n // The name of the organization this application is written for\n orgName: "name-of-company",\n\n // The name of the current project. This usually matches the git repo\'s name\n projectName: "name-of-project",\n\n // optional\n // This changes whether package names that start with @your-org-name are\n // treated as webpack externals or not. Defaults to true\n orgPackagesAsExternal: true,\n\n // See https://webpack.js.org/guides/environment-variables/#root for explanation of webpackConfigEnv\n webpackConfigEnv,\n\n // The CLI commands in the package.json script that triggered this build\n argv,\n\n // optional, defaults to 1\n // This is the rootDirectoryLevel that is passed to https://github.com/joeldenning/systemjs-webpack-interop\n rootDirectoryLevel: 1,\n\n // optional, defaults to false.\n // When true, this removes html-webpack-plugin and standalone-single-spa-webpack-plugin\n disableHtmlGeneration: false,\n });\n\n return webpackMerge.smart(defaultConfig, {\n // modify the webpack config however you\'d like to by adding to this object\n });\n};\n'})}),"\n",(0,s.jsx)(n.h2,{id:"custom-webpack-configuration",children:"Custom Webpack configuration"}),"\n",(0,s.jsxs)(n.p,{children:["Our shared Webpack configs are intended to be extensible to fit the requirements of your applications. These custom config options can be made in each project's ",(0,s.jsx)(n.code,{children:"webpack.config.js"})," file generated by create-single-spa, or used as the basis for a tailored shared config for your organization."]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Use ",(0,s.jsx)(n.code,{children:"require.resolve"})," to reuse loaders that are included as dependencies","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"this is especially useful for reusing any of webpack-config-single-spa-*'s dependencies"}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["webpack-merge ",(0,s.jsx)(n.a,{href:"https://github.com/survivejs/webpack-merge#limitations",children:"does not support merging configs exported as a function"}),", which may be relevant if creating shared config packages. webpack-config-single-spa-* configs require ",(0,s.jsx)(n.code,{children:"webpackConfigEnv"})," and ",(0,s.jsx)(n.code,{children:"argv"})," parameters which necesitates ",(0,s.jsx)(n.a,{href:"https://webpack.js.org/configuration/configuration-types/#exporting-a-function",children:"exporting a config function"})," but return a plain object. This makes it compatible with webpack-merge."]}),"\n",(0,s.jsxs)(n.li,{children:["Use webpack-merge's ",(0,s.jsx)(n.a,{href:"https://github.com/survivejs/webpack-merge#mergewithrules",children:(0,s.jsx)(n.code,{children:"mergeWithRules"})})," function to merge and de-duplicate ",(0,s.jsx)(n.a,{href:"https://webpack.js.org/configuration/module/#modulerules",children:"webpack rules"})]}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"example-load-svgs-as-components",children:"Example: load SVGs as components"}),"\n",(0,s.jsxs)(n.p,{children:["You must also install ",(0,s.jsx)(n.a,{href:"https://www.npmjs.com/package/@svgr/webpack",children:"@svgr/webpack"}),"."]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsx)(n.p,{children:"Available in webpack-config-single-spa@5.3.0+"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'const singleSpaDefaults = require("webpack-config-single-spa");\nconst { mergeWithRules } = require("webpack-merge");\n\nconst merge = mergeWithRules({\n module: {\n rules: {\n // replace the entire `rule` if the `test` property matches\n test: "match",\n use: "replace",\n },\n },\n});\n\nmodule.exports = (env, argv) => {\n const defaultConfig = singleSpaDefaults({\n orgName: "abcde",\n projectName: "fghij",\n webpackConfigEnv: env,\n argv,\n });\n\n const config = merge(defaultConfig, {\n module: {\n rules: [\n {\n test: /\\.svg$/i,\n use: [{ loader: "@svgr/webpack" }],\n },\n ],\n },\n });\n\n // console.dir(config, null, 2) // useful for debugging\n return config;\n};\n'})}),"\n",(0,s.jsx)(n.h3,{id:"replacing-plugins",children:"Replacing plugins"}),"\n",(0,s.jsxs)(n.p,{children:["Use webpack-merge's ",(0,s.jsx)(n.a,{href:"https://github.com/survivejs/webpack-merge#mergewithcustomize-customizearray-customizeobject-configuration--configuration",children:(0,s.jsx)(n.code,{children:"mergeWithCustomize"})})," to resolve duplicate plugins or replace instances. Duplicate plugins often result in cryptic errors!"]}),"\n",(0,s.jsxs)(n.p,{children:["When referencing a loader that is installed as a dependency of webpack-config-single-spa, use ",(0,s.jsx)(n.a,{href:"https://nodejs.org/api/modules.html#modules_require_resolve_request_options",children:"require.resolve"})," to ensure its path is resolved correctly."]}),"\n",(0,s.jsx)(n.h4,{id:"example-replace-htmlwebpackplugin-instance",children:"Example: replace HtmlWebpackPlugin instance"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'const { mergeWithCustomize, unique } = require("webpack-merge");\nconst singleSpaDefaults = require("webpack-config-single-spa");\nconst HtmlWebpackPlugin = require("html-webpack-plugin");\n\nconst merge = mergeWithCustomize({\n customizeArray: unique(\n "plugins",\n ["HtmlWebpackPlugin"],\n (plugin) => plugin.constructor && plugin.constructor.name,\n ),\n});\n\nmodule.exports = (env, argv) => {\n const orgName = "example";\n const myEnv = process.env.NODE_ENV || "development";\n\n const defaultConfig = singleSpaDefaults({\n orgName,\n projectName: "custom-root-config",\n webpackConfigEnv: env,\n argv,\n });\n\n const config = merge(defaultConfig, {\n plugins: [\n new HtmlWebpackPlugin({\n inject: false,\n template: "src/custom.ejs",\n templateParameters: {\n isLocal: env?.isLocal,\n // additional templateParameters can now be supplied\n orgName,\n environment: myEnv,\n },\n }),\n ],\n });\n\n // console.dir(config, null, 2) // useful for debugging\n return config;\n};\n'})})]})}function g(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},8453:(e,n,a)=>{a.d(n,{R:()=>o,x:()=>c});var s=a(6540);const i={},t=s.createContext(i);function o(e){const n=s.useContext(t);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),s.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.7ef0dfe4.js b/assets/js/runtime~main.807b7bb4.js similarity index 99% rename from assets/js/runtime~main.7ef0dfe4.js rename to assets/js/runtime~main.807b7bb4.js index 14e8fb250..713790d09 100644 --- a/assets/js/runtime~main.7ef0dfe4.js +++ b/assets/js/runtime~main.807b7bb4.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,c,f,d={},b={};function r(e){var a=b[e];if(void 0!==a)return a.exports;var c=b[e]={id:e,loaded:!1,exports:{}};return d[e].call(c.exports,c,c.exports,r),c.loaded=!0,c.exports}r.m=d,r.c=b,e=[],r.O=(a,c,f,d)=>{if(!c){var b=1/0;for(i=0;inpm install --save-dev webpack-config-single-spa-react webpack-merge
# or
yarn add --dev webpack-config-single-spa-react webpack-merge
const singleSpaDefaults = require('webpack-config-single-spa-react');
const webpackMerge = require('webpack-merge');
module.exports = (webpackConfigEnv, argv) => {
const defaultConfig = singleSpaDefaults({
// The name of the organization this application is written for
orgName: 'name-of-company',
// The name of the current project. This usually matches the git repo's name
projectName: 'name-of-project',
// See https://webpack.js.org/guides/environment-variables/#root for explanation of webpackConfigEnv
webpackConfigEnv,
// The CLI commands in the package.json script that triggered this build
argv,
// optional
// This changes whether package names that start with @your-org-name are
// treated as webpack externals or not. Defaults to true
orgPackagesAsExternal: true,
// optional, defaults to 1
// This is the rootDirectoryLevel that is passed to https://github.com/joeldenning/systemjs-webpack-interop
rootDirectoryLevel: 1,
// optional, defaults to {}
// This controls the options given to standalone-single-spa-webpack-plugin
// See https://github.com/single-spa/standalone-single-spa-webpack-plugin#usage
standaloneOptions: {},
});
// modify the webpack config however you'd like to by adding to this object
});
};
const singleSpaDefaults = require('webpack-config-single-spa-react');
const webpackMerge = require('webpack-merge');
module.exports = (webpackConfigEnv, argv) => {
const defaultConfig = singleSpaDefaults({
// The name of the organization this application is written for
orgName: 'name-of-company',
// The name of the current project. This usually matches the git repo's name
projectName: 'name-of-project',
// See https://webpack.js.org/guides/environment-variables/#root for explanation of webpackConfigEnv
webpackConfigEnv,
// The CLI commands in the package.json script that triggered this build
argv,
// optional
// This changes whether package names that start with @your-org-name are
// treated as webpack externals or not. Defaults to true
orgPackagesAsExternal: true,
// optional, defaults to 1
// This is the rootDirectoryLevel that is passed to https://github.com/joeldenning/systemjs-webpack-interop
rootDirectoryLevel: 1,
// optional, defaults to {}
// This controls the options given to standalone-single-spa-webpack-plugin
// See https://github.com/single-spa/standalone-single-spa-webpack-plugin#usage
standaloneOptions: {},
});
return merge(defaultConfig, {
// modify the webpack config however you'd like to by adding to this object
});
};
A shareable, customizable webpack config that adds typescript-specific configuration to webpack-config-single-spa
. Note that webpack-config-single-spa-ts has a peerDependency on typescript
.