Optional cdn?: WebpackCdnOptionsOptions for if you need to serve your assets from a CDN server
When should you use this:
- Changes original asset filenames
- Gives a different URL for each asset file
or if you need to set a publicPath other than "auto". Normally, webpack can auto detect
the correct base URL, but if that doesn't work and you know ahead of time what it can be, you
can set it.
If "auto" doesn't work and you don't know ahead of time what publicPath should be, then
you would need CDN mapping.
About how CDN and mapping affects publicPath
publicPath to "auto".publicPath is forced to be the following:
- module federation remote assets -
"auto"- normal assets -
"/js"
Optional cdnHost name to use for CDN simulation, see option cdnProtocol for more info.
WEBPACK_DEV_CDN_HOSTOptional cdnHost name to use for CDN simulation, see option cdnProtocol for more info.
WEBPACK_DEV_CDN_PORTOptional cdnUsing a built-in reverse proxy, the webpack dev assets are served from the same host and port as the app. In that case, the URLs to assets are relative without protocol, host, port.
However, user can simulate CDN server with the proxy and have assets URLs specifying different host/port from the app. To do that, the following should be defined.
WEBPACK_DEV_CDN_PROTOCOLOptional cssConfigure CSS module support.
Settings:
true or "cssOnly" (default): CSS module for any file with .css extension"all": CSS module for all style files (css, styl, sass, scss)"byModExt": Use the preset RegExp that matches any file ending with .mod.{ext} or .module.{ext}
ie: /\.(mod|module)\.(css|styl|sass|scss)$/ifalse: Disable CSS module completelyCSS_MODULE_SUPPORT.Optional devin dev mode, all webpack output are saved to memory only, but some files like stats.json are needed by different uses and the stats partial saves a copy to disk. It will use this as the path to save the file.
.etmpWEBPACK_DEV_ARTIFACTS_PATHOptional devHost name to use for webpack dev URL. Default: localhost
WEBPACK_HOST, then WEBPACK_DEV_HOST, and finally HOSTOptional devIn dev mode, this sets the proxy forward port for the webpack dev server.
If it's not defined or 0, then a randomly available port is picked every time.
Default: 0 - pick a random port
If not set, then check env WEBPACK_DEV_PORT
.
Optional enableEnable loading @babel/polyfill for application
falseOptional enableSupport hot module reload for your web app code
trueWEBPACK_HOT_MODULE_RELOADOptional enableEnable webpack's NodeSourcePlugin to simulate node.js libs in browser
falseENABLE_NODESOURCE_PLUGIN"@remarks" This will bundle 100K+ of JavaScript to simulate node.js env
Optional enableIf CSS module is used, then use a shorten class name for CSS in production mode
trueENABLE_SHORTEN_CSS_NAMESOptional enableIf hot module reload is enabled, then if you make a change that has error, then an overlay on top of the browser page will show the error.
trueWEBPACK_DEV_WARNINGS_OVERLAYOptional loadCustom object with list of webpack DLLs to load
{}ELECTRODE_LOAD_DLLS (which should be a JSON string)Optional minify?: booleanShould webpack minify code output in production mode?
trueOptional minimizeCode splitting should optimize to minimize the number of JS chunks are generated.
Default: false
MINIMIZE_SUBAPP_CHUNKSOptional optimizeCustom options for optimizing critical CSS
OPTIMIZE_CSS_OPTIONS (which should be a JSON string)Optional preservehttps://webpack.js.org/configuration/resolve/#resolve-symlinks
falseWEBPACK_PRESERVE_SYMLINKS, then NODE_PRESERVE_SYMLINKSOptional useUse this flag to control how we load your webpack.config.js|ts.
When you create your own webpack.config.js|ts to customize webpack config, we start webpack
with your config, which is responsible for loading xarc's internal config.
If you want to turn off this behavior so we start with xarc's internal webpack config and then load yours, then set this to false.
If you use .ts (typescript) for your config file, then we will try to load ts-node/register.
You need to install ts-node package and have your tsconfig setup for your typescript.
Optional v1Specify Module Federation options to expose or consume remote V1 subapps through webpack5's ModuleFederationPlugin. See docs at https://webpack.js.org/concepts/module-federation/
TODO: Exposing SubApps remotely has these limitations:
publicPath must be "auto" to expose subapps remotely."single" shared webpack runtimeChunk optimization.this is only for subappV1
Optional webpackEnable webpack dev mode. Default: false
WEBPACK_DEVOptional woffSize limit to prevent inlining woff fonts data
1000WOFF_FONT_INLINE_LIMIT
User configurable options that are related to Webpack