@modern-js/main-doc 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.turbo/turbo-build.log +1 -1
- package/en/components/init-app.mdx +1 -1
- package/en/configure/app/dev/asset-prefix.mdx +1 -1
- package/en/configure/app/dev/hmr.mdx +1 -1
- package/en/configure/app/dev/https.mdx +1 -1
- package/en/configure/app/dev/port.mdx +1 -1
- package/en/configure/app/dev/progress-bar.mdx +1 -1
- package/en/configure/app/dev/start-url.mdx +1 -1
- package/en/configure/app/experiments/lazy-compilation.mdx +1 -1
- package/en/configure/app/html/app-icon.mdx +1 -1
- package/en/configure/app/html/crossorigin.mdx +1 -1
- package/en/configure/app/html/disable-html-folder.mdx +1 -1
- package/en/configure/app/html/favicon-by-entries.mdx +1 -1
- package/en/configure/app/html/favicon.mdx +1 -1
- package/en/configure/app/html/inject-by-entries.mdx +1 -1
- package/en/configure/app/html/inject.mdx +1 -1
- package/en/configure/app/html/meta-by-entries.mdx +1 -1
- package/en/configure/app/html/meta.mdx +1 -1
- package/en/configure/app/html/mount-id.mdx +1 -1
- package/en/configure/app/html/tags-by-entries.mdx +1 -1
- package/en/configure/app/html/tags.mdx +1 -1
- package/en/configure/app/html/template-by-entries.mdx +1 -1
- package/en/configure/app/html/template-parameters-by-entries.mdx +1 -1
- package/en/configure/app/html/template-parameters.mdx +1 -1
- package/en/configure/app/html/template.mdx +1 -1
- package/en/configure/app/html/title-by-entries.mdx +1 -1
- package/en/configure/app/html/title.mdx +1 -1
- package/en/configure/app/output/asset-prefix.mdx +1 -1
- package/en/configure/app/output/assets-retry.mdx +1 -1
- package/en/configure/app/output/charset.mdx +1 -1
- package/en/configure/app/output/clean-dist-path.mdx +1 -1
- package/en/configure/app/output/convert-to-rem.mdx +1 -1
- package/en/configure/app/output/copy.mdx +1 -1
- package/en/configure/app/output/css-module-local-ident-name.mdx +1 -1
- package/en/configure/app/output/data-uri-limit.mdx +1 -1
- package/en/configure/app/output/disable-css-extract.mdx +1 -1
- package/en/configure/app/output/disable-css-module-extension.mdx +1 -1
- package/en/configure/app/output/disable-filename-hash.mdx +1 -1
- package/en/configure/app/output/disable-inline-runtime-chunk.mdx +1 -1
- package/en/configure/app/output/disable-minimize.mdx +1 -1
- package/en/configure/app/output/disable-source-map.mdx +1 -1
- package/en/configure/app/output/disable-ts-checker.mdx +1 -1
- package/en/configure/app/output/dist-path.mdx +1 -1
- package/en/configure/app/output/enable-asset-fallback.mdx +1 -1
- package/en/configure/app/output/enable-asset-manifest.mdx +1 -1
- package/en/configure/app/output/enable-css-module-tsdeclaration.mdx +1 -1
- package/en/configure/app/output/enable-inline-scripts.mdx +1 -1
- package/en/configure/app/output/enable-inline-styles.mdx +1 -1
- package/en/configure/app/output/enable-latest-decorators.mdx +1 -1
- package/en/configure/app/output/externals.mdx +1 -1
- package/en/configure/app/output/filename.mdx +1 -1
- package/en/configure/app/output/legal-comments.mdx +1 -1
- package/en/configure/app/output/override-browserslist.mdx +1 -1
- package/en/configure/app/output/polyfill.mdx +1 -1
- package/en/configure/app/output/svg-default-export.mdx +1 -1
- package/en/configure/app/performance/build-cache.mdx +1 -1
- package/en/configure/app/performance/bundle-analyze.mdx +1 -1
- package/en/configure/app/performance/chunk-split.mdx +1 -1
- package/en/configure/app/performance/print-file-size.mdx +1 -1
- package/en/configure/app/performance/profile.mdx +1 -1
- package/en/configure/app/performance/remove-console.mdx +1 -1
- package/en/configure/app/performance/remove-moment-locale.mdx +1 -1
- package/en/configure/app/security/check-syntax.mdx +1 -1
- package/en/configure/app/security/sri.mdx +1 -1
- package/en/configure/app/source/alias.mdx +1 -1
- package/en/configure/app/source/compile-js-data-uri.mdx +1 -1
- package/en/configure/app/source/define.mdx +1 -1
- package/en/configure/app/source/exclude.mdx +1 -1
- package/en/configure/app/source/global-vars.mdx +1 -1
- package/en/configure/app/source/include.mdx +1 -1
- package/en/configure/app/source/module-scopes.mdx +1 -1
- package/en/configure/app/source/pre-entry.mdx +1 -1
- package/en/configure/app/source/resolve-extension-prefix.mdx +1 -1
- package/en/configure/app/source/resolve-main-fields.mdx +1 -1
- package/en/configure/app/tools/autoprefixer.mdx +1 -1
- package/en/configure/app/tools/babel.mdx +1 -1
- package/en/configure/app/tools/css-extract.mdx +1 -1
- package/en/configure/app/tools/css-loader.mdx +1 -1
- package/en/configure/app/tools/dev-server.mdx +1 -1
- package/en/configure/app/tools/html-plugin.mdx +1 -1
- package/en/configure/app/tools/inspector.mdx +1 -1
- package/en/configure/app/tools/less.mdx +1 -1
- package/en/configure/app/tools/minify-css.mdx +1 -1
- package/en/configure/app/tools/postcss.mdx +1 -1
- package/en/configure/app/tools/pug.mdx +1 -1
- package/en/configure/app/tools/sass.mdx +1 -1
- package/en/configure/app/tools/style-loader.mdx +1 -1
- package/en/configure/app/tools/styled-components.mdx +1 -1
- package/en/configure/app/tools/terser.mdx +1 -1
- package/en/configure/app/tools/ts-checker.mdx +1 -1
- package/en/configure/app/tools/ts-loader.mdx +1 -1
- package/en/configure/app/tools/webpack-chain.mdx +1 -1
- package/en/configure/app/tools/webpack.mdx +1 -1
- package/en/configure/app/usage.mdx +63 -0
- package/en/guides/advanced-features/_category_.json +5 -0
- package/en/guides/advanced-features/ssr.mdx +2 -2
- package/en/guides/basic-features/_category_.json +5 -0
- package/en/guides/basic-features/builder.mdx +1 -1
- package/en/guides/basic-features/routes.mdx +28 -0
- package/en/guides/concept/_category_.json +5 -0
- package/en/guides/get-started/_category_.json +5 -0
- package/en/guides/topic-detail/generator/config/{mwa.mdx → app.mdx} +1 -1
- package/en/guides/topic-detail/generator/plugin/api/new/createElement.mdx +1 -1
- package/en/guides/topic-detail/generator/plugin/api/new/enableFunc.mdx +1 -1
- package/en/guides/topic-detail/generator/plugin/api/new/introduce.mdx +1 -1
- package/en/guides/topic-detail/generator/plugin/develop.mdx +2 -2
- package/package.json +3 -3
- package/scripts/config.ts +1 -1
- package/zh/components/custom-router-micro-frontend.mdx +40 -0
- package/zh/components/enable-micro-frontend.mdx +12 -2
- package/zh/components/micro-runtime-config.mdx +9 -10
- package/zh/configure/app/dev/asset-prefix.mdx +1 -1
- package/zh/configure/app/dev/hmr.mdx +1 -1
- package/zh/configure/app/dev/https.mdx +1 -1
- package/zh/configure/app/dev/port.mdx +1 -1
- package/zh/configure/app/dev/progress-bar.mdx +1 -1
- package/zh/configure/app/dev/start-url.mdx +1 -1
- package/zh/configure/app/experiments/lazy-compilation.mdx +1 -1
- package/zh/configure/app/html/app-icon.mdx +1 -1
- package/zh/configure/app/html/crossorigin.mdx +1 -1
- package/zh/configure/app/html/disable-html-folder.mdx +1 -1
- package/zh/configure/app/html/favicon-by-entries.mdx +1 -1
- package/zh/configure/app/html/favicon.mdx +1 -1
- package/zh/configure/app/html/inject-by-entries.mdx +1 -1
- package/zh/configure/app/html/inject.mdx +1 -1
- package/zh/configure/app/html/meta-by-entries.mdx +1 -1
- package/zh/configure/app/html/meta.mdx +1 -1
- package/zh/configure/app/html/mount-id.mdx +1 -1
- package/zh/configure/app/html/tags-by-entries.mdx +1 -1
- package/zh/configure/app/html/tags.mdx +1 -1
- package/zh/configure/app/html/template-by-entries.mdx +1 -1
- package/zh/configure/app/html/template-parameters-by-entries.mdx +1 -1
- package/zh/configure/app/html/template-parameters.mdx +1 -1
- package/zh/configure/app/html/template.mdx +1 -1
- package/zh/configure/app/html/title-by-entries.mdx +1 -1
- package/zh/configure/app/html/title.mdx +1 -1
- package/zh/configure/app/output/asset-prefix.mdx +1 -1
- package/zh/configure/app/output/assets-retry.mdx +1 -1
- package/zh/configure/app/output/charset.mdx +1 -1
- package/zh/configure/app/output/clean-dist-path.mdx +1 -1
- package/zh/configure/app/output/convert-to-rem.mdx +1 -1
- package/zh/configure/app/output/copy.mdx +1 -1
- package/zh/configure/app/output/css-module-local-ident-name.mdx +1 -1
- package/zh/configure/app/output/data-uri-limit.mdx +1 -1
- package/zh/configure/app/output/disable-css-extract.mdx +1 -1
- package/zh/configure/app/output/disable-css-module-extension.mdx +1 -1
- package/zh/configure/app/output/disable-filename-hash.mdx +1 -1
- package/zh/configure/app/output/disable-inline-runtime-chunk.mdx +1 -1
- package/zh/configure/app/output/disable-minimize.mdx +1 -1
- package/zh/configure/app/output/disable-source-map.mdx +1 -1
- package/zh/configure/app/output/disable-ts-checker.mdx +1 -1
- package/zh/configure/app/output/dist-path.mdx +1 -1
- package/zh/configure/app/output/enable-asset-fallback.mdx +1 -1
- package/zh/configure/app/output/enable-asset-manifest.mdx +1 -1
- package/zh/configure/app/output/enable-css-module-tsdeclaration.mdx +1 -1
- package/zh/configure/app/output/enable-inline-scripts.mdx +1 -1
- package/zh/configure/app/output/enable-inline-styles.mdx +1 -1
- package/zh/configure/app/output/enable-latest-decorators.mdx +1 -1
- package/zh/configure/app/output/externals.mdx +1 -1
- package/zh/configure/app/output/filename.mdx +1 -1
- package/zh/configure/app/output/legal-comments.mdx +1 -1
- package/zh/configure/app/output/override-browserslist.mdx +1 -1
- package/zh/configure/app/output/polyfill.mdx +1 -1
- package/zh/configure/app/output/svg-default-export.mdx +1 -1
- package/zh/configure/app/performance/build-cache.mdx +1 -1
- package/zh/configure/app/performance/bundle-analyze.mdx +1 -1
- package/zh/configure/app/performance/chunk-split.mdx +1 -1
- package/zh/configure/app/performance/print-file-size.mdx +1 -1
- package/zh/configure/app/performance/profile.mdx +1 -1
- package/zh/configure/app/performance/remove-console.mdx +1 -1
- package/zh/configure/app/performance/remove-moment-locale.mdx +1 -1
- package/zh/configure/app/security/check-syntax.mdx +1 -1
- package/zh/configure/app/security/sri.mdx +1 -1
- package/zh/configure/app/source/alias.mdx +1 -1
- package/zh/configure/app/source/compile-js-data-uri.mdx +1 -1
- package/zh/configure/app/source/define.mdx +1 -1
- package/zh/configure/app/source/exclude.mdx +1 -1
- package/zh/configure/app/source/global-vars.mdx +1 -1
- package/zh/configure/app/source/include.mdx +1 -1
- package/zh/configure/app/source/module-scopes.mdx +1 -1
- package/zh/configure/app/source/pre-entry.mdx +1 -1
- package/zh/configure/app/source/resolve-extension-prefix.mdx +1 -1
- package/zh/configure/app/source/resolve-main-fields.mdx +1 -1
- package/zh/configure/app/tools/autoprefixer.mdx +1 -1
- package/zh/configure/app/tools/babel.mdx +1 -1
- package/zh/configure/app/tools/css-extract.mdx +1 -1
- package/zh/configure/app/tools/css-loader.mdx +1 -1
- package/zh/configure/app/tools/dev-server.mdx +1 -1
- package/zh/configure/app/tools/html-plugin.mdx +1 -1
- package/zh/configure/app/tools/inspector.mdx +1 -1
- package/zh/configure/app/tools/less.mdx +1 -1
- package/zh/configure/app/tools/minify-css.mdx +1 -1
- package/zh/configure/app/tools/postcss.mdx +1 -1
- package/zh/configure/app/tools/pug.mdx +1 -1
- package/zh/configure/app/tools/sass.mdx +1 -1
- package/zh/configure/app/tools/style-loader.mdx +1 -1
- package/zh/configure/app/tools/styled-components.mdx +1 -1
- package/zh/configure/app/tools/terser.mdx +1 -1
- package/zh/configure/app/tools/ts-checker.mdx +1 -1
- package/zh/configure/app/tools/ts-loader.mdx +1 -1
- package/zh/configure/app/tools/webpack-chain.mdx +1 -1
- package/zh/configure/app/tools/webpack.mdx +1 -1
- package/zh/configure/app/usage.mdx +63 -0
- package/zh/guides/advanced-features/ssr.mdx +2 -2
- package/zh/guides/basic-features/routes.mdx +28 -1
- package/zh/guides/topic-detail/generator/config/{mwa.mdx → app.mdx} +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/new/createElement.mdx +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/new/enableFunc.mdx +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/new/introduce.mdx +2 -2
- package/zh/guides/topic-detail/generator/plugin/develop.mdx +3 -3
- package/zh/guides/topic-detail/micro-frontend/c02-development.mdx +128 -61
- package/zh/guides/topic-detail/micro-frontend/c03-main-app.mdx +71 -40
@@ -5,7 +5,7 @@ sidebar_label: printFileSize
|
|
5
5
|
# performance.printFileSize
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [performance.printFileSize](https://modernjs.dev/builder/en/api/config-performance.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [performance.printFileSize](https://modernjs.dev/builder/en/api/config-performance.html#performanceprintfilesize)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/performance/printFileSize.md'
|
@@ -5,7 +5,7 @@ sidebar_label: profile
|
|
5
5
|
# performance.profile
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [performance.profile](https://modernjs.dev/builder/en/api/config-performance.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [performance.profile](https://modernjs.dev/builder/en/api/config-performance.html#performanceprofile)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/performance/profile.md'
|
@@ -5,7 +5,7 @@ sidebar_label: removeConsole
|
|
5
5
|
# performance.removeConsole
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [performance.removeConsole](https://modernjs.dev/builder/en/api/config-performance.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [performance.removeConsole](https://modernjs.dev/builder/en/api/config-performance.html#performanceremoveconsole)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/performance/removeConsole.md'
|
@@ -5,7 +5,7 @@ sidebar_label: removeMomentLocale
|
|
5
5
|
# performance.removeMomentLocale
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [performance.removeMomentLocale](https://modernjs.dev/builder/en/api/config-performance.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [performance.removeMomentLocale](https://modernjs.dev/builder/en/api/config-performance.html#performanceremovemomentlocale)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/performance/removeMomentLocale.md'
|
@@ -5,7 +5,7 @@ sidebar_label: checkSyntax
|
|
5
5
|
# security.checkSyntax
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [security.checkSyntax](https://modernjs.dev/builder/en/api/config-security.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [security.checkSyntax](https://modernjs.dev/builder/en/api/config-security.html#securitychecksyntax)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/security/checkSyntax.md'
|
@@ -5,7 +5,7 @@ sidebar_label: sri
|
|
5
5
|
# security.sri
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [security.sri](https://modernjs.dev/builder/en/api/config-security.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [security.sri](https://modernjs.dev/builder/en/api/config-security.html#securitysri)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/security/sri.md'
|
@@ -5,7 +5,7 @@ sidebar_label: alias
|
|
5
5
|
# source.alias
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [source.alias](https://modernjs.dev/builder/en/api/config-source.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [source.alias](https://modernjs.dev/builder/en/api/config-source.html#sourcealias)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/source/alias.md'
|
@@ -5,7 +5,7 @@ sidebar_label: compileJsDataURI
|
|
5
5
|
# source.compileJsDataURI
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [source.compileJsDataURI](https://modernjs.dev/builder/en/api/config-source.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [source.compileJsDataURI](https://modernjs.dev/builder/en/api/config-source.html#sourcecompilejsdatauri)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/source/compileJsDataURI.md'
|
@@ -5,7 +5,7 @@ sidebar_label: define
|
|
5
5
|
# source.define
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [source.define](https://modernjs.dev/builder/en/api/config-source.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [source.define](https://modernjs.dev/builder/en/api/config-source.html#sourcedefine)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/source/define.md'
|
@@ -5,7 +5,7 @@ sidebar_label: exclude
|
|
5
5
|
# source.exclude
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [source.exclude](https://modernjs.dev/builder/en/api/config-source.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [source.exclude](https://modernjs.dev/builder/en/api/config-source.html#sourceexclude)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/source/exclude.md'
|
@@ -5,7 +5,7 @@ sidebar_label: globalVars
|
|
5
5
|
# source.globalVars
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [source.globalVars](https://modernjs.dev/builder/en/api/config-source.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [source.globalVars](https://modernjs.dev/builder/en/api/config-source.html#sourceglobalvars)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/source/globalVars.md'
|
@@ -5,7 +5,7 @@ sidebar_label: include
|
|
5
5
|
# source.include
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [source.include](https://modernjs.dev/builder/en/api/config-source.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [source.include](https://modernjs.dev/builder/en/api/config-source.html#sourceinclude)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/source/include.md'
|
@@ -5,7 +5,7 @@ sidebar_label: moduleScopes
|
|
5
5
|
# source.moduleScopes
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [source.moduleScopes](https://modernjs.dev/builder/en/api/config-source.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [source.moduleScopes](https://modernjs.dev/builder/en/api/config-source.html#sourcemodulescopes)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/source/moduleScopes.md'
|
@@ -5,7 +5,7 @@ sidebar_label: preEntry
|
|
5
5
|
# source.preEntry
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [source.preEntry](https://modernjs.dev/builder/en/api/config-source.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [source.preEntry](https://modernjs.dev/builder/en/api/config-source.html#sourcepreentry)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/source/preEntry.md'
|
@@ -5,7 +5,7 @@ sidebar_label: resolveExtensionPrefix
|
|
5
5
|
# source.resolveExtensionPrefix
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [source.resolveExtensionPrefix](https://modernjs.dev/builder/en/api/config-source.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [source.resolveExtensionPrefix](https://modernjs.dev/builder/en/api/config-source.html#sourceresolveextensionprefix)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/source/resolveExtensionPrefix.md'
|
@@ -5,7 +5,7 @@ sidebar_label: resolveMainFields
|
|
5
5
|
# source.resolveMainFields
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [source.resolveMainFields](https://modernjs.dev/builder/en/api/config-source.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [source.resolveMainFields](https://modernjs.dev/builder/en/api/config-source.html#sourceresolvemainfields)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/source/resolveMainFields.md'
|
@@ -5,7 +5,7 @@ sidebar_label: autoprefixer
|
|
5
5
|
# tools.autoprefixer
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.autoprefixer](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.autoprefixer](https://modernjs.dev/builder/en/api/config-tools.html#toolsautoprefixer)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/autoprefixer.md'
|
@@ -5,7 +5,7 @@ sidebar_label: babel
|
|
5
5
|
# tools.babel
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.babel](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.babel](https://modernjs.dev/builder/en/api/config-tools.html#toolsbabel)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/babel.md'
|
@@ -5,7 +5,7 @@ sidebar_label: cssExtract
|
|
5
5
|
# tools.cssExtract
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.cssExtract](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.cssExtract](https://modernjs.dev/builder/en/api/config-tools.html#toolscssextract)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/cssExtract.md'
|
@@ -5,7 +5,7 @@ sidebar_label: cssLoader
|
|
5
5
|
# tools.cssLoader
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.cssLoader](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.cssLoader](https://modernjs.dev/builder/en/api/config-tools.html#toolscssloader)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/cssLoader.md'
|
@@ -5,7 +5,7 @@ sidebar_label: devServer
|
|
5
5
|
# tools.devServer
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.devServer](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.devServer](https://modernjs.dev/builder/en/api/config-tools.html#toolsdevserver)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/devServer.md'
|
@@ -5,7 +5,7 @@ sidebar_label: htmlPlugin
|
|
5
5
|
# tools.htmlPlugin
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.htmlPlugin](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.htmlPlugin](https://modernjs.dev/builder/en/api/config-tools.html#toolshtmlplugin)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/htmlPlugin.md'
|
@@ -5,7 +5,7 @@ sidebar_label: inspector
|
|
5
5
|
# tools.inspector
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.inspector](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.inspector](https://modernjs.dev/builder/en/api/config-tools.html#toolsinspector)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/inspector.md'
|
@@ -5,7 +5,7 @@ sidebar_label: less
|
|
5
5
|
# tools.less
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.less](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.less](https://modernjs.dev/builder/en/api/config-tools.html#toolsless)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/less.md'
|
@@ -5,7 +5,7 @@ sidebar_label: minifyCss
|
|
5
5
|
# tools.minifyCss
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.minifyCss](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.minifyCss](https://modernjs.dev/builder/en/api/config-tools.html#toolsminifycss)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/minifyCss.md'
|
@@ -5,7 +5,7 @@ sidebar_label: postcss
|
|
5
5
|
# tools.postcss
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.postcss](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.postcss](https://modernjs.dev/builder/en/api/config-tools.html#toolspostcss)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/postcss.md'
|
@@ -5,7 +5,7 @@ sidebar_label: pug
|
|
5
5
|
# tools.pug
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.pug](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.pug](https://modernjs.dev/builder/en/api/config-tools.html#toolspug)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/pug.md'
|
@@ -5,7 +5,7 @@ sidebar_label: sass
|
|
5
5
|
# tools.sass
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.sass](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.sass](https://modernjs.dev/builder/en/api/config-tools.html#toolssass)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/sass.md'
|
@@ -5,7 +5,7 @@ sidebar_label: styleLoader
|
|
5
5
|
# tools.styleLoader
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.styleLoader](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.styleLoader](https://modernjs.dev/builder/en/api/config-tools.html#toolsstyleloader)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/styleLoader.md'
|
@@ -5,7 +5,7 @@ sidebar_label: styledComponents
|
|
5
5
|
# tools.styledComponents
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.styledComponents](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.styledComponents](https://modernjs.dev/builder/en/api/config-tools.html#toolsstyledcomponents)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/styledComponents.md'
|
@@ -5,7 +5,7 @@ sidebar_label: terser
|
|
5
5
|
# tools.terser
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.terser](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.terser](https://modernjs.dev/builder/en/api/config-tools.html#toolsterser)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/terser.md'
|
@@ -5,7 +5,7 @@ sidebar_label: tsChecker
|
|
5
5
|
# tools.tsChecker
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.tsChecker](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.tsChecker](https://modernjs.dev/builder/en/api/config-tools.html#toolstschecker)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/tsChecker.md'
|
@@ -5,7 +5,7 @@ sidebar_label: tsLoader
|
|
5
5
|
# tools.tsLoader
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.tsLoader](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.tsLoader](https://modernjs.dev/builder/en/api/config-tools.html#toolstsloader)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/tsLoader.md'
|
@@ -5,7 +5,7 @@ sidebar_label: webpackChain
|
|
5
5
|
# tools.webpackChain
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.webpackChain](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.webpackChain](https://modernjs.dev/builder/en/api/config-tools.html#toolswebpackchain)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/webpackChain.md'
|
@@ -5,7 +5,7 @@ sidebar_label: webpack
|
|
5
5
|
# tools.webpack
|
6
6
|
|
7
7
|
:::tip
|
8
|
-
This config is provided by Modern.js Builder, more detail can see [tools.webpack](https://modernjs.dev/builder/en/api/config-tools.html#
|
8
|
+
This config is provided by Modern.js Builder, more detail can see [tools.webpack](https://modernjs.dev/builder/en/api/config-tools.html#toolswebpack)。
|
9
9
|
:::
|
10
10
|
|
11
11
|
import Main from '@modern-js/builder-doc/docs/en/config/tools/webpack.md'
|
@@ -69,6 +69,69 @@ export default defineConfig({
|
|
69
69
|
});
|
70
70
|
```
|
71
71
|
|
72
|
+
### Export Configuration Function
|
73
|
+
|
74
|
+
Modern.js supports exporting a function in the configuration file, and you can dynamically compute the configuration in the function and return it to Modern.js.
|
75
|
+
|
76
|
+
```js title="modern.config.js"
|
77
|
+
import { defineConfig } from '@modern-js/app-tools';
|
78
|
+
|
79
|
+
export default defineConfig(({ env, command }) => ({
|
80
|
+
source: {
|
81
|
+
alias: {
|
82
|
+
'@foo': env === 'development' ? './src/foo.dev.ts' : './src/foo.prod.ts',
|
83
|
+
},
|
84
|
+
},
|
85
|
+
}));
|
86
|
+
```
|
87
|
+
|
88
|
+
This function takes the following parameters:
|
89
|
+
|
90
|
+
- `env`: same as the value of `process.env.NODE_ENV`.
|
91
|
+
- When running `modern dev` or `modern start`, the value of `env` is `development`.
|
92
|
+
- When running `modern build` or `modern serve`, the value of `env` is `production`.
|
93
|
+
- When running `modern test`, the value of `env` is `test`.
|
94
|
+
- `command`: corresponds to the currently running command, such as `dev`, `start`, `build`, `serve`.
|
95
|
+
|
96
|
+
### Export Async Function
|
97
|
+
|
98
|
+
Modern.js also supports exporting an asynchronous function in the configuration file, you can perform some asynchronous operations in the function:
|
99
|
+
|
100
|
+
```js title="modern.config.js"
|
101
|
+
import { defineConfig } from '@modern-js/app-tools';
|
102
|
+
|
103
|
+
export default defineConfig(async ({ env, command }) => {
|
104
|
+
const result = await someAsyncFunction();
|
105
|
+
|
106
|
+
return {
|
107
|
+
html: {
|
108
|
+
title: result,
|
109
|
+
},
|
110
|
+
};
|
111
|
+
});
|
112
|
+
```
|
113
|
+
|
114
|
+
### Specify the Configuration File
|
115
|
+
|
116
|
+
You can specify the name of the configuration file using the `--config` option.
|
117
|
+
|
118
|
+
For example, if you need to use the `modern.prod.config.js` file when running build, you can add the following scripts to `package.json`:
|
119
|
+
|
120
|
+
```json title="package.json"
|
121
|
+
{
|
122
|
+
"scripts": {
|
123
|
+
"dev": "modern dev",
|
124
|
+
"build": "modern build --config modern.prod.config.js"
|
125
|
+
}
|
126
|
+
}
|
127
|
+
```
|
128
|
+
|
129
|
+
You can also abbreviate the `--config` option to `-c`:
|
130
|
+
|
131
|
+
```bash
|
132
|
+
$ modern build -c modern.prod.config.js
|
133
|
+
```
|
134
|
+
|
72
135
|
## Configure in package.json (not recommended)
|
73
136
|
|
74
137
|
In addition to configuration files, configuration options can also be set the `modernConfig` field in the `package.json`, such as:
|
@@ -254,11 +254,11 @@ In the second case, the Treeshaking method does not guarantee that the code is c
|
|
254
254
|
For example, the import of `fs-extra` in the code, when it is directly referenced to the component, will cause the CSR to load an error. You can create `.ts` and `.node.ts` files of the same name as a layer of proxy:
|
255
255
|
|
256
256
|
```ts title="compat.ts"
|
257
|
-
export
|
257
|
+
export const readFileSync: any = () => {};
|
258
258
|
```
|
259
259
|
|
260
260
|
```ts title="compat.node.ts"
|
261
|
-
export
|
261
|
+
export { readFileSync } from 'fs-extra';
|
262
262
|
```
|
263
263
|
|
264
264
|
use `./compat` directly into the file. At this time, files with the `.node.ts` suffix will be used first in the SSR environment, and files with the `.ts` suffix will be used in the CSR environment.
|
@@ -6,7 +6,7 @@ sidebar_position: 2
|
|
6
6
|
|
7
7
|
**Modern.js uses [Modern.js Builder](https://modernjs.dev/builder) to build your Web App.**
|
8
8
|
|
9
|
-
Modern.js Builder is one of the core components of Modern.js. It is
|
9
|
+
Modern.js Builder is one of the core components of Modern.js. It is A Build Engine for web development. and can be used independently of Modern.js. Modern.js Builder supports multiple bundlers such as webpack and rspack, and it uses webpack by default.
|
10
10
|
|
11
11
|
## Build Architecture
|
12
12
|
|
@@ -134,6 +134,34 @@ The `routes/[id]/page.tsx` file is converted to the `/:id` route. Except for the
|
|
134
134
|
|
135
135
|
In component, you can get the corresponding named parameters through [useParams](/apis/app/runtime/router/#useparams).
|
136
136
|
|
137
|
+
### Catch all routing
|
138
|
+
|
139
|
+
If a `$.tsx` file is created in the routes directory, this file will act as a wildcard route component that will be rendered when there is no matching route.
|
140
|
+
|
141
|
+
:::note
|
142
|
+
`$.tsx` can be thought of as a special `page` routing component that renders `$.tsx` as a child of `layout` when there is a `layout` component in the current directory.
|
143
|
+
:::
|
144
|
+
|
145
|
+
For example, the following directory structure:
|
146
|
+
|
147
|
+
```
|
148
|
+
└── routes
|
149
|
+
├── $.tsx
|
150
|
+
├── blog
|
151
|
+
│ └── page.tsx
|
152
|
+
└── page.tsx
|
153
|
+
```
|
154
|
+
|
155
|
+
The `routes/$.tsx` component is rendered when accessing any path that does not match, and again, the remainder of the url can be captured in `$.tsx` using [useParams](/apis/app/runtime/router/#useparams).
|
156
|
+
|
157
|
+
```ts title="$.tsx"
|
158
|
+
import { useParams } from '@modern-js/runtime/router';
|
159
|
+
// When the path is `/aaa/bbb`
|
160
|
+
const params = useParams();
|
161
|
+
params['*'] // => 'aaa/bbb'
|
162
|
+
```
|
163
|
+
|
164
|
+
|
137
165
|
### Layout with No Path
|
138
166
|
|
139
167
|
When a directory name begins with `__`, the corresponding directory name is not converted to the actual routing path, such as the following file directory:
|
@@ -30,4 +30,4 @@ Project element type, supports entry and server.
|
|
30
30
|
|
31
31
|
## params
|
32
32
|
|
33
|
-
For other parameters of creating elements, please refer to[
|
33
|
+
For other parameters of creating elements, please refer to[App New Command](/guides/topic-detail/generator/config/app).
|
@@ -41,4 +41,4 @@ The function name is passed according to the functions supported by the differen
|
|
41
41
|
|
42
42
|
## params
|
43
43
|
|
44
|
-
For other parameters when the function is enabled, please refer to[
|
44
|
+
For other parameters when the function is enabled, please refer to [App New Command](/guides/topic-detail/generator/config/app) and [Module New Command](/guides/topic-detail/generator/config/module).
|
@@ -8,7 +8,7 @@ The three engineering solutions provided by the Modern.js support executing the
|
|
8
8
|
|
9
9
|
Different engineering solutions to support new operations:
|
10
10
|
|
11
|
-
- [
|
11
|
+
- [Web App](/guides/topic-detail/generator/config/app)
|
12
12
|
|
13
13
|
- [Module](/guides/topic-detail/generator/config/module)
|
14
14
|
|
@@ -23,7 +23,7 @@ Different plugin types will ask different questions. You can choose the plugin t
|
|
23
23
|
? Development Language TS
|
24
24
|
? Package Management Tool pnpm
|
25
25
|
? Plugin Type extend
|
26
|
-
? Plugin Base Type
|
26
|
+
? Plugin Base Type Web App Solution
|
27
27
|
```
|
28
28
|
|
29
29
|
### Customized type
|
@@ -35,7 +35,7 @@ Different plugin types will ask different questions. You can choose the plugin t
|
|
35
35
|
? Plugin Type custom
|
36
36
|
? Plugin Key mobile-app
|
37
37
|
? Plugin Show Name Mobile App
|
38
|
-
? Plugin Base Type
|
38
|
+
? Plugin Base Type Web App Solution
|
39
39
|
```
|
40
40
|
|
41
41
|
After the execution of the create project command is completed, a project for developing the generator plugin will be generated accordingly, and the `meta` information will also be generated according to your selection in the `package.json`.
|
package/package.json
CHANGED
@@ -11,13 +11,13 @@
|
|
11
11
|
"modern",
|
12
12
|
"modern.js"
|
13
13
|
],
|
14
|
-
"version": "2.
|
14
|
+
"version": "2.4.0",
|
15
15
|
"publishConfig": {
|
16
16
|
"registry": "https://registry.npmjs.org/",
|
17
17
|
"access": "public"
|
18
18
|
},
|
19
19
|
"peerDependencies": {
|
20
|
-
"@modern-js/builder-doc": "^2.
|
20
|
+
"@modern-js/builder-doc": "^2.4.0"
|
21
21
|
},
|
22
22
|
"devDependencies": {
|
23
23
|
"ts-node": "^10",
|
@@ -25,7 +25,7 @@
|
|
25
25
|
"fs-extra": "^10",
|
26
26
|
"@types/node": "^16",
|
27
27
|
"@types/fs-extra": "^9",
|
28
|
-
"@modern-js/builder-doc": "2.
|
28
|
+
"@modern-js/builder-doc": "2.4.0"
|
29
29
|
},
|
30
30
|
"scripts": {
|
31
31
|
"build": "npx ts-node ./scripts/sync.ts"
|
package/scripts/config.ts
CHANGED
@@ -27,7 +27,7 @@ sidebar_label: ${name}
|
|
27
27
|
:::tip
|
28
28
|
${
|
29
29
|
tip[lng]
|
30
|
-
} [${dirname}.${name}](https://modernjs.dev/builder${langPrefix}/api/config-${dirname}.html#${dirname}
|
30
|
+
} [${dirname}.${name}](https://modernjs.dev/builder${langPrefix}/api/config-${dirname}.html#${dirname}${name.toLowerCase()})。
|
31
31
|
:::
|
32
32
|
|
33
33
|
import Main from '@modern-js/builder-doc/docs/${lng}/config/${dirname}/${name}.md'
|