diff --git a/packages/docs/docs/plugin/option-api.md b/packages/docs/docs/plugin/option-api.md index 2f48709b40..9aff03baa6 100644 --- a/packages/docs/docs/plugin/option-api.md +++ b/packages/docs/docs/plugin/option-api.md @@ -271,7 +271,7 @@ Sometimes, you may want to generate some client modules at compile time. module.exports = (options, context) => ({ clientDynamicModules() { return { - name: 'constans.js', + name: 'constants.js', content: `export const SOURCE_DIR = '${context.sourceDir}'` } } @@ -281,7 +281,7 @@ module.exports = (options, context) => ({ Then you can use this module at client side code by: ``` js -import { SOURCE_DIR } from '@dynamic/constans' +import { SOURCE_DIR } from '@dynamic/constants' ``` ## extendPageData diff --git a/packages/docs/docs/zh/plugin/option-api.md b/packages/docs/docs/zh/plugin/option-api.md index 055222385f..ff305cf86f 100644 --- a/packages/docs/docs/zh/plugin/option-api.md +++ b/packages/docs/docs/zh/plugin/option-api.md @@ -275,7 +275,7 @@ module.exports = (option, context) => { module.exports = (options, context) => ({ clientDynamicModules() { return { - name: 'constans.js', + name: 'constants.js', content: `export const SOURCE_DIR = '${context.sourceDir}'` } } @@ -285,7 +285,7 @@ module.exports = (options, context) => ({ 然后你可以在客户端这样使用你的模块: ``` js -import { SOURCE_DIR } from '@dynamic/constans' +import { SOURCE_DIR } from '@dynamic/constants' ``` ## extendPageData