index int64 0 0 | repo_id stringlengths 16 181 | file_path stringlengths 28 270 | content stringlengths 1 11.6M | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/disableHtmlFolder.md | - **Type:** `boolean`
- **Default:** `false`
Remove the folder of the HTML files. When this option is enabled, the generated HTML file path will change from `[name]/index.html` to `[name].html`.
### Example
By default, the structure of HTML files in the `dist` directory is:
```bash
/dist
βββ html
βββ main
... | 6,700 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/favicon.md | - **Type:** `string`
- **Default:** `undefined`
Set the favicon icon path for all pages, can be set as:
- a URL.
- an absolute path to the file.
- a relative path relative to the project root directory.
After config this option, the favicon will be automatically copied to the dist directory during the compilation, a... | 6,701 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/faviconByEntries.md | - **Type:** `Record<string, string>`
- **Default:** `undefined`
Set different favicon for different pages.
The usage is same as `favicon`, and you can use the "entry name" as the key to set each page individually.
`faviconByEntries` will overrides the value set in `favicon`.
### Example
```js
export default {
ht... | 6,702 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/inject.md | - **Type:** `'head' | 'body' | 'true' | false`
- **Default:** `'head'`
Set the inject position of the `<script>` tag.
Can be set to the following values:
- `'head'`: The script tag will be inject inside the head tag.
- `'body'`: The script tag is inject at the end of the body tag.
- `true`: The result depends on the... | 6,703 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/injectByEntries.md | - **Type:** `Record<string, boolean | string>`
- **Default:** `undefined`
Set different script tag inject positions for different pages.
The usage is same as `inject`, and you can use the "entry name" as the key to set each page individually.
`injectByEntries` will overrides the value set in `inject`.
### Example
... | 6,704 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/meta.md | - **Type:** `Record<string, false | string | Record<string, string | boolean>>`
- **Default:** `undefined`
Configure the `<meta>` tag of the HTML.
### String Type
When the `value` of a `meta` object is a string, the `key` of the object is automatically mapped to `name`, and the `value` is mapped to `content`.
For e... | 6,705 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/metaByEntries.md | - **Type:** `Record<string, Meta>`
- **Default:** `undefined`
Set different meta tags for different pages.
The usage is same as `meta`, and you can use the "entry name" as the key to set each page individually.
`metaByEntries` will overrides the value set in `meta`.
### Example
```js
export default {
html: {
... | 6,706 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/mountId.md | - **Type:** `string`
- **Default:** `'root'`
By default, the `root` element is included in the HTML template for component mounting, and the element id can be modified through `mountId`.
```html
<body>
<div id="root"></div>
</body>
```
### Example
Set the `id` to `app`:
```js
export default {
html: {
mount... | 6,707 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/scriptLoading.md | - **Type:** `'defer' | 'blocking' | 'module'`
- **Default:** `'defer'`
Used to set how `<script>` tags are loaded.
### defer
By default, the `<script>` tag generated by Builder will automatically set the `defer` attribute to avoid blocking the parsing and rendering of the page.
```html
<head>
<script defer src="/... | 6,708 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/tags.md | - **Type:** `ArrayOrNot<HtmlInjectTag | HtmlInjectTagHandler>`
- **Default:** `undefined`
Modifies the tags that are injected into the HTML page.
#### Tag Object
```ts
export interface HtmlInjectTag {
tag: string;
attrs?: Record<string, string | boolean | null | undefined>;
children?: string;
/** @default fa... | 6,709 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/tagsByEntries.md | - **Type:** `Record<string, ArrayOrNot<HtmlInjectTag | HtmlInjectTagHandler>>`
- **Default:** `undefined`
Used for multiple entry applications, injecting different tags for each entry.
The usage is the same as `tags`, and you can use the "entry name" as the key to set each page individually.
`tagsByEntries` will ove... | 6,710 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/template.md | - **Type:** `string`
- **Default:**
Define the path to the HTML template, corresponding to the `template` config of [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin).
### Example
Replace the default template with a custom HTML template file, you can add the following config:
```js
export defaul... | 6,711 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/templateByEntries.md | - **Type:** `Object`
- **Default:** `undefined`
Set different template file for different pages.
The usage is same as `template`, and you can use the "entry name" as the key to set each page individually.
`templateByEntries` will overrides the value set in `template`.
### Example
```js
export default {
html: {
... | 6,712 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/templateParameters.md | - **Type:** `Object | Function`
- **Default:**
```ts
type DefaultParameters = {
meta: string; // corresponding to html.meta config
title: string; // corresponding to html.title config
mountId: string; // corresponding to html.mountId config
entryName: string; // entry name
assetPrefix: string; // correspondi... | 6,713 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/templateParametersByEntries.md | - **Type:** `Object`
- **Default:** `undefined`
Set different template parameters for different pages.
The usage is same as `templateParameters`, and you can use the "entry name" as the key to set each page individually.
`templateParametersByEntries` will overrides the value set in `templateParameters`.
### Example... | 6,714 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/title.md | - **Type:** `string`
- **Default:** `undefined`
Set the title tag of the HTML page, for example:
```js
export default {
html: {
title: 'example',
},
};
```
| 6,715 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/html/titleByEntries.md | - **Type:** `Record<string, string>`
- **Default:** `undefined`
Set different title for different pages.
The usage is same as `title`, and you can use the "entry name" as the key to set each page individually.
`titleByEntries` will overrides the value set in `title`.
### Example
```js
export default {
html: {
... | 6,716 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/assetPrefix.md | - **Type:** `string`
- **Default:** `'/'`
When using CDN in the production environment, you can use this option to set the URL prefix of static assets.
`assetPrefix` will affect the URLs of most of the static assets, including JavaScript files, CSS files, images, videos, etc. If an incorrect value is specified, you'l... | 6,717 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/assetsRetry.md | - **Type:** `Object`
`output.assetsRetry` is used to configure the retry of assets.The type of `AssetsRetryOptions` is as follows:
```ts
export type AssetsRetryHookContext = {
times: number;
domain: string;
url: string;
tagName: string;
};
export type AssetsRetryOptions = {
type?: string[];
domain?: stri... | 6,718 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/charset.md | - **Type:** `'ascii' | 'utf8'`
- **Default:** `'ascii'`
By default, Builder's output is ASCII-only and will escape all non-ASCII characters.
If you want to output the original characters without using escape sequences, you can set `output.charset` to `utf8`.
```js
export default {
output: {
charset: 'utf8',
... | 6,719 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/cleanDistPath.md | - **Type:** `boolean`
- **Default:** `true`
Whether to clean all files in the dist path before starting compilation.
By default, Builder clean up the dist file, you can disable this behavior by setting `cleanDistPath` to `false`.
```js
export default {
output: {
cleanDistPath: false,
},
};
```
| 6,720 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/convertToRem.md | - **Type:** `boolean | object`
- **Default:** `false`
By setting `output.convertToRem`, the Builder can do the following things:
- Convert px to rem in CSS.
- Insert runtime code into the HTML template to set the fontSize of the root element.
### Boolean Type
If `output.convertToRem` is set to `true`, Rem processin... | 6,721 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/copy.md | - **Type:** `CopyPluginOptions | CopyPluginOptions['patterns']`
- **Default:** `undefined`
Copies the specified file or directory to the dist directory.
For example, copy the files under `src/assets` to the dist directory:
```js
export default {
output: {
copy: [{ from: './src/assets', to: '' }],
},
};
```
... | 6,722 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/cssModuleLocalIdentName.md | - **Type:** `string`
- **Default:**
```ts
// isProd indicates that the production build
const localIdentName = isProd
? '[local]-[hash:base64:6]'
: '[path][name]__[local]-[hash:base64:6]';
```
Sets the format of the className generated by CSS Modules after compilation.
### Default Value
`cssModuleLocalIdentName... | 6,723 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/cssModules.md | - **Type:**
```ts
type CssModuleLocalsConvention =
| 'asIs'
| 'camelCase'
| 'camelCaseOnly'
| 'dashes'
| 'dashesOnly';
type CssModules = {
auto?: boolean | RegExp | ((resourcePath: string) => boolean);
exportLocalsConvention?: CssModuleLocalsConvention;
};
```
- **Default:**
```ts
const defaultCssModu... | 6,724 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/dataUriLimit.md | - **Type:**
```ts
type DataUriLimitConfig = {
svg?: number;
font?: number;
image?: number;
media?: number;
};
```
- **Default:**
```js
const defaultDatUriLimit = {
svg: 10000,
font: 10000,
image: 10000,
media: 10000,
};
```
Set the size threshold to inline static assets such as images and fonts.
By... | 6,725 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/disableCssExtract.md | - **Type:** `boolean`
- **Default:** `false`
Whether to disable CSS extract and inline CSS files into JS files.
By default, Builder will extract CSS into a separate `.css` file and output it to the dist directory. When this option is set to `true`, CSS files will be inlined into JS files and inserted on the page at r... | 6,726 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/disableCssModuleExtension.md | - **Type:** `boolean`
- **Default:** `false`
Whether to treat all `.css` files in the source directory as CSS Modules.
By default, only the `*.module.css` files are treated as CSS Modules. After enabling this config, all `*.css` style files in the source directory will be regarded as CSS Modules.
`.sass`, `.scss` an... | 6,727 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/disableFilenameHash.md | - **Type:** `boolean`
- **Default:** `false`
Remove the hash from the name of static files after production build.
After the production build, there will be a hash in the middle of the filename by default. You can disable this behavior through the `output.disableFilenameHash` config.
### Example
By default, the fil... | 6,728 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/disableInlineRuntimeChunk.md | - **Type:** `boolean`
- **Default:** `false`
Used to control whether to inline the bundler's runtime code into HTML.
:::tip What is runtimeChunk
Builder will generate a `builder-runtime.js` file in the dist directory, which is the runtime code of webpack or Rspack.
runtimeChunk is a piece of runtime code, which is ... | 6,729 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/disableMinimize.md | - **Type:** `boolean`
- **Default:** `false`
Whether to disable code minification on production builds.
By default, JS and CSS code is minified during the production build to improve the page performance. If you do not want to the code to be minified, you can set `disableMinimize` to `true`.
```js
export default {
... | 6,730 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/disableSourceMap.md | - **Type:**
```ts
type DisableSourceMap =
| boolean
| {
js?: boolean;
css?: boolean;
};
```
- **Default:**
```ts
const defaultDisableSourceMap = {
js: false,
css: process.env.NODE_ENV === 'production',
};
```
Whether to disable Source Map generation.
:::tip What is a Source Map
Source Map i... | 6,731 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/disableSvgr.md | - **Type:** `boolean`
- **Default:** `false`
Whether to transform SVGs into React components. If true, will treat all .svg files as assets.
By default, when an SVG resource is referenced in a JS file, Builder will call SVGR to convert the SVG into a React component. If you are sure that all SVG resources in your proj... | 6,732 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/disableTsChecker.md | - **Type:** `boolean`
- **Default:** `false`
Whether to disable TypeScript type checker during compilation.
By default, Builder will run the TypeScript type checker in a separate process during the build process. Its checking logic is consistent with TypeScript's native `tsc` command. You can use `tsconfig.json` or B... | 6,733 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/distPath.md | - **Type:**
```ts
type DistPathConfig = {
root?: string;
html?: string;
js?: string;
css?: string;
svg?: string;
font?: string;
wasm?: string;
image?: string;
media?: string;
server?: string;
worker?: string;
};
```
- **Default:**
```js
const defaultDistPath = {
root: 'dist',
html: 'html',
... | 6,734 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/enableAssetFallback.md | - **Type:** `boolean`
- **Default:** `false`
If this option is enabled, all unrecognized files will be emitted to the dist directory; otherwise, an exception will be thrown.
### Example
Enable the config:
```js
export default {
output: {
enableAssetFallback: true,
},
};
```
Import a module of unknown type ... | 6,735 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/enableAssetManifest.md | - **Type:** `boolean`
- **Default:** `false`
Whether to generate a manifest file that contains information of all assets.
### Example
Enable asset manifest:
```js
export default {
output: {
enableAssetManifest: true,
},
};
```
After compiler, there will be a `dist/manifest.json` file:
```json
{
"files":... | 6,736 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/enableCssModuleTSDeclaration.md | - **Type:** `boolean`
- **Default:** `false`
Whether to generate a TypeScript declaration file for CSS modules.
### Example
Enable CSS module TypeScript declaration:
```js
export default {
output: {
enableCssModuleTSDeclaration: true,
},
};
```
After building, there will be a `.d.ts` file for each CSS modu... | 6,737 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/enableInlineScripts.md | - **Type:**
```ts
type EnableInlineScripts =
| boolean
| RegExp
| ((params: { size: number; name: string }) => boolean);
```
- **Default:** `false`
- **Bundler:** `only support webpack`
Whether to inline output scripts files (.js files) into HTML with `<script>` tags in production mode.
Note that, with this o... | 6,738 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/enableInlineStyles.md | - **Type:**
```ts
type EnableInlineStyles =
| boolean
| RegExp
| ((params: { size: number; name: string }) => boolean);
```
- **Default:** `false`
Whether to inline output style files (.css files) into HTML with `<style>` tags in production mode.
Note that, with this option on, the style files will no longer ... | 6,739 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/enableLatestDecorators.md | - **Type:** `boolean`
- **Default:** `false`
Whether to use the new decorator proposal.
By default, Builder uses the [legacy decorator proposal](https://github.com/wycats/javascript-decorators/blob/e1bf8d41bfa2591d949dd3bbf013514c8904b913/README.md) when compiling decorators.
When `output.enableLatestDecorators` is ... | 6,740 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/externals.md | - **Type:** `string | object | function | RegExp`
- **Default:** `undefined`
At build time, prevent some `import` dependencies from being packed into bundles in your code, and instead fetch them externally at runtime.
For more information, please see: [webpack Externals](https://webpack.js.org/configuration/external... | 6,741 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/filename.md | - **Type:**
```ts
type FilenameConfig = {
js?: string;
css?: string;
svg?: string;
font?: string;
image?: string;
media?: string;
};
```
- **Default:**
```js
// Development
const devDefaultFilename = {
js: '[name].js',
css: '[name].css',
svg: '[name].[contenthash:8].svg',
font: '[name].[contentha... | 6,742 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/legalComments.md | - **Type:** `'linked' | 'inline' | 'none'`
- **Default:** `'linked'`
Configure how to handle the legal comment.
A "legal comment" is considered to be any statement-level comment in JS or rule-level comment in CSS that contains @license or @preserve or that starts with //! or /\*!. These comments are preserved in outp... | 6,743 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/overrideBrowserslist.md | - **Type:** `string[] | Record<BuilderTarget, string[]`
- **Default:** `undefined`
Specifies the range of target browsers that the project is compatible with. This value will be used by [@babel/preset-env](https://babeljs.io/docs/en/babel-preset-env) and [autoprefixer](https://github.com/postcss/autoprefixer) to ident... | 6,744 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/polyfill.md | - **Type:** `'entry' | 'usage' | 'ua' | 'off'`
- **Default:** `'entry'`
Via `output.polyfill` you can configure how the polyfill is injected.
### Config
#### entry
Polyfill is injected in every entry file when `output.polyfill` is configured as `'entry'`.
Equivalent to `useBuiltIns: 'entry'` configuration in `@bab... | 6,745 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/output/svgDefaultExport.md | - **Type:** `'url' | 'component'`
- **Default:** `'url'`
`output.svgDefaultExport` is used to configure the default export type of SVG files.
When `output.svgDefaultExport` is set to `url` , the default export of SVG files is the URL of the file. For example:
```js
import logo from './logo.svg';
console.log(logo); ... | 6,746 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/performance/buildCache.md | - **Type:**
```ts
type BuildCacheConfig =
| {
/**
* Base directory for the filesystem cache.
*/
cacheDirectory?: string;
/**
* Set different cache names based on cacheDigest content.
*/
cacheDigest?: Array<string | undefined>;
}
| boolean;
```
- **Default:**... | 6,747 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/performance/bundleAnalyze.md | - **Type:** `Object | undefined`
Used to enable the [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) plugin to analyze the size of the output.
By default, Builder does not enable `webpack-bundle-analyzer`. When this feature is enabled, the default configuration is as follows:
```... | 6,748 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/performance/chunkSplit.md | - **Type:** `Object`
- **Default:** `{ strategy: 'split-by-experience' }`
`performance.chunkSplit` is used to configure the chunk splitting strategy. The type of `ChunkSplit` is as follows:
```ts
type ForceSplitting = RegExp[] | Record<string, RegExp>;
interface BaseChunkSplit {
strategy?:
| 'split-by-module'
... | 6,749 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/performance/dnsPrefetch.md | - **Type:** `undefined | string[]`
- **Default:** `undefined`
Specifies that the user agent should preemptively perform DNS resolution for the target resource's origin, refer to [dns-prefetch](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/dns-prefetch).
After this property is set, the domain name ... | 6,750 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/performance/preconnect.md | - **Type:** `undefined | Array<string | PreconnectOption>`
```ts
interface PreconnectOption {
href: string;
crossorigin?: boolean;
}
```
- **Default:** `undefined`
Specifies that the user agent should preemptively connect to the target resource's origin, refer to [preconnect](https://developer.mozilla.org/en-US/do... | 6,751 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/performance/prefetch.md | - **Type:** `undefined | true | PrefetchOption`
```ts
type IncludeType = 'async-chunks' | 'initial' | 'all-assets' | 'all-chunks';
type Filter = Array<string | RegExp> | ((filename: string) => boolean);
interface PrefetchOption {
type?: IncludeType;
include?: Filter;
exclude?: Filter;
}
```
- **Default:** `unde... | 6,752 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/performance/preload.md | - **Type:** `undefined | true | PreloadOption`
```ts
type IncludeType = 'async-chunks' | 'initial' | 'all-assets' | 'all-chunks';
type Filter = Array<string | RegExp> | ((filename: string) => boolean);
interface PreloadOption {
type?: IncludeType;
include?: Filter;
exclude?: Filter;
}
```
- **Default:** `undefi... | 6,753 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/performance/printFileSize.md | - **Type:** `boolean`
- **Default:** `true`
Whether to print the file sizes after production build.
```bash
info Production file sizes:
File Size Gzipped
dist/static/js/lib-react.09721b5c.js 152.6 kB 49.0 kB
dist/html/main/index.html 5.8 ... | 6,754 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/performance/profile.md | - **Type:** `boolean`
- **Default:** `false`
Whether capture timing information for each module, same as the [profile](https://webpack.js.org/configuration/other-options/#profile) config of webpack / Rspack.
### Example
```js
export default {
performance: {
profile: true,
},
};
```
When turned on, webpack /... | 6,755 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/performance/removeConsole.md | - **Type:** `boolean | ConsoleType[]`
- **Default:** `false`
Whether to remove `console.xx` in production build.
#### Remove all consoles
When `removeConsole` is set to `true`, all types of `console.xx` are removed:
```ts
export default {
performance: {
removeConsole: true,
},
};
```
#### Remove specific c... | 6,756 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/performance/removeMomentLocale.md | - **Type:** `boolean`
- **Default:** `false`
Whether to remove the locales of [moment.js](https://momentjs.com/).
`moment.js` contains a lot of locales by default, which will increase the bundle size.
When `moment.js` is used in the project, it is recommended to enable this option to automatically exclude all locale... | 6,757 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/performance/transformLodash.md | - **Type:** `boolean`
- **Default:** `true`
- **Bundler:** `only support webpack`
Specifies whether to modularize the import of [lodash](https://www.npmjs.com/package/lodash) and remove unused lodash modules to reduce the code size of lodash.
This optimization is implemented using [babel-plugin-lodash](https://www.np... | 6,758 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/security/checkSyntax.md | - **Type:**
```ts
type CheckSyntax =
| boolean
| {
targets?: string[];
exclude?: RegExp | RegExp[];
ecmaVersion?: EcmaVersion;
};
```
- **Default:** `false`
Used to analyze whether there is incompatible advanced syntax in the build artifacts under the current browser scope. If any incompati... | 6,759 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/security/nonce.md | - **Type:**
```ts
type Nonce = string;
```
- **Default:** `undefined`
Add a random attribute value --- nonce, to the scripts resources introduced for HTML. This allows the browser to determine whether the script can be executed when it parses inline scripts with matching nonce values.
#### Introduce nonce
The nonc... | 6,760 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/security/sri.md | - **Type:**
```ts
type SRIOptions =
| {
hashFuncNames?: string[];
enabled?: 'auto' | boolean;
hashLoading?: 'eager' | 'lazy';
}
| boolean;
```
- **Default:** `undefined`
- **Bundler:** `only support webpack`
Adding an integrity attribute (`integrity`) to sub-resources introduced by HTML all... | 6,761 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/source/alias.md | - **Type:** `Record<string, string | string[]> | Function`
- **Default:** `undefined`
Create aliases to import or require certain modules, same as the [resolve.alias](https://webpack.js.org/configuration/resolve/#resolvealias) config of webpack and Rspack.
:::tip
For TypeScript projects, you only need to configure [c... | 6,762 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/source/aliasStrategy.md | - **Type:** `'prefer-tsconfig' | 'prefer-alias'`
- **Default:** `'prefer-tsconfig'`
`source.aliasStrategy` is used to control the priority between the `paths` option in `tsconfig.json` and the `alias` option in the bundler.
### prefer-tsconfig
By default, `source.aliasStrategy` is set to `'prefer-tsconfig'`. In this... | 6,763 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/source/compileJsDataURI.md | - **Type:** `boolean`
- **Default:** `true`
This option is used to control whether to compile JavaScript code inside data URIs.
By default, Builder uses Babel or SWC to compile the code inside data URIs. For example, the following code:
```js
import x from 'data:text/javascript,export default 1;';
import 'data:text... | 6,764 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/source/define.md | - **Type:** `Record<string, unknown>`
- **Default:** `{}`
Replaces variables in your code with other values or expressions at compile time. This can be useful for allowing different behavior between development builds and production builds.
Each key passed into options is an identifier or multiple identifiers joined ... | 6,765 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/source/exclude.md | - **Type:** `Array<string | RegExp>`
- **Default:** `[]`
- **Bundler:** `only support webpack`
Specifies JavaScript/TypeScript files that do not need to be compiled. The usage is consistent with [Rule.exclude](https://webpack.js.org/configuration/module/#ruleexclude) in webpack, which supports passing in strings or re... | 6,766 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/source/globalVars.md | - **Type:** `Record<string, JSONValue> | Function`
- **Default:**
```ts
const defaultGlobalVars = {
// The environment variable `process.env.NODE_ENV` will be added by default,
// so you don't need to set it in manually.
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
};
```
Used to define global ... | 6,767 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/source/include.md | - **Type:** `Array<string | RegExp>`
- **Default:** `[]`
- **Bundler:** `only support webpack`
In order to maintain faster compilation speed, Builder will not compile JavaScript/TypeScript files under node_modules through `babel-loader` or `ts-loader` by default, as will as the JavaScript/TypeScript files outside the ... | 6,768 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/source/moduleScopes.md | - **Type:** `Array<string | Regexp> | Function`
- **Default:** `undefined`
- **Bundler:** `only support webpack`
Restrict importing paths. After configuring this option, all source files can only import code from the specific paths, and import code from other paths is not allowed.
### Example
First, we configure `mo... | 6,769 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/source/preEntry.md | - **Type:** `string | string[]`
- **Default:** `undefined`
Add a script before the entry file of each page. This script will be executed before the page code. It can be used to execute global logics, such as injecting polyfills, setting global styles, etc.
#### Add a single script
First create a `src/polyfill.ts` fi... | 6,770 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/source/resolveExtensionPrefix.md | - **Type:** `string | Record<BuilderTarget, string>`
- **Default:** `undefined`
Add a prefix to [resolve.extensions](https://webpack.js.org/configuration/resolve/#resolveextensions).
If multiple files share the same name but have different extensions, Builder will resolve the one with the extension listed first in th... | 6,771 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/source/resolveMainFields.md | - **Type:**
```ts
type Fields = (string | string[])[];
type ResolveMainFields = Fields | Record<BuilderTarget, Fields>;
```
- **Default:** `undefined`
This config will determine which field of `package.json` you use to import the `npm` module. Same as the [resolve.mainFields](https://webpack.js.org/configuration/re... | 6,772 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/source/transformImport.md | Used to import the code and style of the component library on demand, which is equivalent to [babel-plugin-import](https://www.npmjs.com/package/babel-plugin-import).
The difference between it and [babel-plugin-import](https://www.npmjs.com/package/babel-plugin-import) is that `source.transformImport` is not coupled w... | 6,773 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/autoprefixer.md | - **Type:** `Object | Function`
- **Default:**
```js
{
flexbox: 'no-2009',
// Depends on the browserslist config in the project
// and the `output.overrideBrowserslist` (higher priority) config
overrideBrowserslist: browserslist,
}
```
You can modify the config of [autoprefixer](https://github.com/postcss/aut... | 6,774 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/babel.md | - **Type:** `Object | Function`
- **Default:** `undefined`
With `tools.babel` you can modify the options of [babel-loader](https://github.com/babel/babel-loader).
### Usage Scenarios
Please note the limitations of `tools.babel` in the following usage scenarios:
- Rspack scenario: When using Rspack as the bundler, u... | 6,775 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/bundlerChain.mdx | - **Type:** `Function | undefined`
- **Default:** `undefined`
You can modify the webpack and Rspack configuration by configuring `tools.bundlerChain` which is type of `Function`. The function receives two parameters, the first is the original bundler chain object, and the second is an object containing some utils.
::... | 6,776 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/cssExtract.md | - **Type:** `Object | Function`
- **Default:**
```js
const defaultOptions = {
// The loader options
loaderOptions: {},
// The plugin options
pluginOptions: {
// The default value of cssPath is `static/css`
// while the default value of cssFilename is `[name].[contenthash:8].css`
filename: `${cssPat... | 6,777 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/cssLoader.md | - **Type:** `Object | Function`
- **Default:** `undefined`
The config of [css-loader](https://github.com/webpack-contrib/css-loader) can be modified through `tools.cssLoader`. The default config is as follows:
```js
{
modules: {
auto: true,
exportLocalsConvention: 'camelCase',
localIdentName: config.out... | 6,778 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/devServer.md | - **Type:** `Object`
- **Default:** `{}`
The config of DevServer can be modified through `tools.devServer`.
:::tip
Modern.js does not directly use [webpack-dev-server](https://webpack.js.org/api/webpack-dev-server/) or [@rspack/dev-server](https://www.rspack.dev/guide/dev-server.html), but implement DevServer based o... | 6,779 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/htmlPlugin.md | - **Type:** `false | Object | Function`
- **Default:**
```js
const defaultHtmlPluginOptions = {
inject, // corresponding to the html.inject config
favicon, // corresponding to html.favicon config
filename, // generated based on output.distPath and entryName
template, // defaults to the built-in HTML template p... | 6,780 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/inspector.md | - **Type:** `Object | Function | undefined`
- **Default:** `undefined`
- **Bundler:** `only support webpack`
You can enable or configure the [webpack inspector](https://github.com/web-infra-dev/webpack-inspector) through `tools.inspector`.
When the configuration is not `undefined`, it means that `webpack-inspector` i... | 6,781 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/less.md | - **Type:** `Object | Function`
- **Default:**
```js
const defaultOptions = {
lessOptions: {
javascriptEnabled: true,
},
// CSS Source Map enabled by default in development environment
sourceMap: isDev,
};
```
You can modify the config of [less-loader](https://github.com/webpack-contrib/less-loader) via `... | 6,782 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/minifyCss.md | - **Type:** `Object | Function | undefined`
- **Default:**
```js
const defaultOptions = {
minimizerOptions: {
preset: [
'default',
{
mergeLonghand: false,
},
],
},
};
```
When building for production, Builder will minimize the CSS code through [css-minimizer-webpack-plugin](https... | 6,783 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/postcss.md | - **Type:** `Object | Function`
- **Default:**
```js
const defaultOptions = {
postcssOptions: {
plugins: [
// The following plugins are enabled by default
require('postcss-nesting'),
require('postcss-media-minmax'),
require('postcss-flexbugs-fixes'),
require('autoprefixer')({
... | 6,784 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/pug.md | - **Type:** `true | Object | Function | undefined`
- **Default:** `false`
Configure the [Pug](https://pugjs.org/) template engine.
### Boolean Type
Pug template engine is not enabled by default, you can enable it by setting `tools.pug` to `true`.
```ts
export default {
tools: {
pug: true,
},
};
```
When en... | 6,785 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/rspack.md | - **Type:** `Object | Function | undefined`
- **Default:** `undefined`
- **Bundler:** `only support Rspack`
`tools.rspack` is used to configure [Rspack](https://www.rspack.dev/).
### Object Type
`tools.rspack` can be configured as an object to be deep merged with the built-in Rspack configuration through [webpack-me... | 6,786 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/sass.md | - **Type:** `Object | Function`
- **Default:**
```js
const defaultOptions = {
// CSS Source Map enabled by default in development environment
sourceMap: isDev,
};
```
You can modify the config of [sass-loader](https://github.com/webpack-contrib/sass-loader) via `tools.sass`.
### Object Type
When `tools.sass` is... | 6,787 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/styleLoader.md | - **Type:** `Object | Function`
- **Default:** `{}`
The config of [style-loader](https://github.com/webpack-contrib/style-loader) can be set through `tools.styleLoader`.
It is worth noting that Builder does not enable `style-loader` by default. You can use `output.disableCssExtract` config to enable it.
### Object T... | 6,788 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/styledComponents.md | - **Type:** `Object | Function`
- **Default:**
```js
{
displayName: true,
// `isSSR` is true in SSR build
ssr: isSSR,
// `pure` is enabled in production to reduce bundle size
pure: isProd,
transpileTemplateLiterals: true,
}
```
- **Bundler:** `only support webpack`
`tools.styledComponents` config is corr... | 6,789 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/terser.md | - **Type:** `Object | Function | undefined`
- **Default:**
```js
const defaultTerserOptions = {
terserOptions: {
mangle: {
safari10: true,
},
},
};
```
- **Bundler:** `only support webpack`
When building for production, Builder will minimize the JavaScript code through [terser-webpack-plugin](https... | 6,790 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/tsChecker.md | - **Type:** `Object | Function`
- **Default:**
```js
const defaultOptions = {
typescript: {
// avoid OOM issue
memoryLimit: 8192,
// use tsconfig of user project
configFile: tsconfigPath,
// use typescript of user project
typescriptPath: require.resolve('typescript'),
},
issue: {
excl... | 6,791 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/tsLoader.md | - **Type:** `Object | Function | undefined`
- **Default:** `undefined`
- **Bundler:** `only support webpack`
`ts-loader` is not enabled by default in the project. When `tools.tsLoader` is not undefined, builder will use ts-loader instead of babel-loader to compile TypeScript code.
### Object Type
When this value is ... | 6,792 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/webpack.md | - **Type:** `Object | Function | undefined`
- **Default:** `undefined`
- **Bundler:** `only support webpack`
`tools.webpack` is used to configure [webpack](https://webpack.js.org/).
> `tools.bundlerChain` is also used to modify the webpack configuration, and the function is more powerful. It is recommended to use `to... | 6,793 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/config/tools/webpackChain.md | - **Type:** `Function | undefined`
- **Default:** `undefined`
- **Bundler:** `only support webpack`
You can modify the webpack configuration by configuring `tools.webpackChain` which is type of `Function`. The function receives two parameters, the first is the original webpack chain object, and the second is an object... | 6,794 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/guide/features.mdx | # All Features
Here are all the main features supported by Modern.js Builder.
## JavaScript
| Features | Description | Links ... | 6,795 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/guide/glossary.mdx | # Glossary
## Bundler
import Bundler from '@en/shared/bundler.md';
<Bundler />
## Builder
import Builder from '@en/shared/builder.md';
<Builder />
## Builder Provider
Builder Provider is a part of Builder. Providers implements corresponding build feature based on specific bundlers.
Currently there are two Prov... | 6,796 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/guide/introduction.mdx | # Introduction
Modern.js Builder is **a Build Engine for web development**.
With the growing of the front-end ecosystem, more and more build tools and plugins are created. For most developers, the configuration and dependencies required to build a web application have become complex; the cost of finding best practice... | 6,797 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/guide/quick-start.mdx | # Quick Start
## Environment preparation
import NodeVersion from '@en/shared/nodeVersion.md';
<NodeVersion />
## Use the Modern.js Framework
**The Modern.js Framework uses Modern.js Builder as its build tool by default**. If you are a business developer, you do not need to manually install Builder, just create a M... | 6,798 |
0 | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/guide | petrpan-code/web-infra-dev/modern.js/packages/document/builder-doc/docs/en/guide/advanced/alias.mdx | # Path Aliases
import Alias from '@en/shared/alias.md';
<Alias />
| 6,799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.