Skip to content

Commit

Permalink
Merge pull request #15 from Wu-kung/feat/update-qrcode
Browse files Browse the repository at this point in the history
docs: update wechat group qrcode & config docs
  • Loading branch information
sorrycc authored Oct 9, 2024
2 parents e60143a + ae29dbf commit 26595ea
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/blog/mako-internal-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ $ npm create mako

如果你有任何问题或建议,可以在扫码加我们的微信群。

<img src="https://mdn.alipayobjects.com/huamei_lpyngx/afts/img/A*NbqoQJB25dAAAAAAAAAAAAAADjjvAQ/original" width="120" />
<img src="https://mdn.alipayobjects.com/huamei_lpyngx/afts/img/A*4xXlQITJ2agAAAAAAAAAAAAADjjvAQ/original" width="120" />

或者点击以下链接加入 Telegram 群。

Expand Down
2 changes: 1 addition & 1 deletion docs/blog/mako-open-sourced.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ $ npx umi build

If you want to discuss issues or suggestions about Mako, you can scan the QR code to join our WeChat group. (If it's expired or the group is full, please go to https://makojs.dev/docs/feedback for a new QR code.)

<img src="https://mdn.alipayobjects.com/huamei_lpyngx/afts/img/A*NbqoQJB25dAAAAAAAAAAAAAADjjvAQ/original" width="120" />
<img src="https://mdn.alipayobjects.com/huamei_lpyngx/afts/img/A*4xXlQITJ2agAAAAAAAAAAAAADjjvAQ/original" width="120" />

Or click the following link to join our Telegram group.

Expand Down
2 changes: 1 addition & 1 deletion docs/blog/mako-open-sourced_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ $ npx umi build

如果你想交流关于 Mako 的问题或建议,可以扫码加我们的微信群。(过期或群满了请到 https://makojs.dev/docs/feedback 查看新的二维码)

<img src="https://mdn.alipayobjects.com/huamei_lpyngx/afts/img/A*NbqoQJB25dAAAAAAAAAAAAAADjjvAQ/original" width="120" />
<img src="https://mdn.alipayobjects.com/huamei_lpyngx/afts/img/A*4xXlQITJ2agAAAAAAAAAAAAADjjvAQ/original" width="120" />

或者点击以下链接加入 Telegram 群。

Expand Down
109 changes: 100 additions & 9 deletions docs/docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Whether to export only the class names of CSS Modules, not the values of CSS Mod
### define

- Type: `Record<string, string>`
- Default: `{ ['process.env.NODE_ENV']: "development" | "production }`
- Default: `{ NODE_ENV: "development" | "production }`

Specify the variables that need to be replaced in the code.

Expand All @@ -149,6 +149,8 @@ e.g.
}
```

Notice: Currently, define will automatically handle the `process.env` prefix.

### devServer

- Type: `false | { host?: string, port?: number }`
Expand All @@ -163,6 +165,31 @@ Specify the devServer configuration.

Specify the source map type.

### duplicatePackageChecker

- Type: `{ verbose: boolean, showHelp: boolean, emitError: boolean } | false`
- Default: `false`

Configuration for duplicate package checker.

Child configuration items:

- `verbose`: Whether to output detailed information.
- `showHelp`: Whether to show help information.
- `emitError`: Whether to emit an error when duplicate packages are found.

Example:

```json
{
"duplicatePackageChecker": {
"verbose": true,
"showHelp": true,
"emitError": false
}
}
```

### dynamicImportToRequire

- Type: `boolean`
Expand Down Expand Up @@ -215,7 +242,6 @@ e.g.
},
}
```

### experimental.detectLoop

- Type: `false| { "ignoreNodeModules": bool, "graphviz": bool }`
Expand Down Expand Up @@ -370,14 +396,31 @@ Notice: This configuration can only be used with umd, because injecting CSS is n

### inlineLimit

- Type: `number`
- Default: `10000`
- Type: `string[]`
- Default: `[]`

Specify the size limit of the assets file that needs to be converted to `base64` format.


### inlineExcludesExtensions

- Type: `string[]`
- Default: `[]`

Excludes assets file extension list that don't need to be converted to `base64` format.

e.g.

```ts
{
"inlineExcludesExtensions": ["webp"]
}
```


### less

- Type: `{ modifyVars?: Record<string, string>, sourceMap?: { sourceMapFileInline?: boolean, outputSourceFiles?: boolean }, math?: "always" | "strict" | "parens-division" | "parens" | "strict-legacy" | number, plugins?: ([string, Record<string, any>]|string)[] }`
- Type: `{ modifyVars?: Record<string, string>, globalVars?: Record<string, string>, sourceMap?: { sourceMapFileInline?: boolean, outputSourceFiles?: boolean }, math?: "always" | "strict" | "parens-division" | "parens" | "strict-legacy" | number, plugins?: ([string, Record<string, any>]|string)[] }`
- Default: `{}`

Specify the less configuration.
Expand All @@ -390,6 +433,10 @@ e.g.
'primary-color': '#1DA57A',
'link-color': '#1DA57A',
},
globalVars: {
'primary-color': '#ffff00',
hack: 'true; @import "your-global-less-file.less";',
},
sourceMap: {
sourceMapFileInline: true,
outputSourceFiles: true,
Expand Down Expand Up @@ -431,7 +478,7 @@ Specify the build mode, `"development"` or `"production"`.

### moduleIdStrategy

- Type: `"named" | "hashed"`
- Type: `"named" | "hashed" | "numeric"`
- Default: `"named"` when mode is development, `"hashed"` when mode is production

Specify the strategy for generating moduleId.
Expand All @@ -445,8 +492,8 @@ Whether to enable node polyfill.

### output

- Type: `{ path: string, mode: "bundle" | "bundless", esVersion: "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "esnext", meta: boolean, chunkLoadingGlobal: string, preserveModules: boolean, preserveModulesRoot: string }`
- Default: `{ path: "dist", mode: "bundle", esVersion: "es2022", meta: false, chunkLoadingGlobal: "", preserveModules: false, preserveModulesRoot: "" }`
- Type: `{ path: string, mode: "bundle" | "bundless", esVersion: "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "esnext", meta: boolean, chunkLoadingGlobal: string, preserveModules: boolean, preserveModulesRoot: string; crossOriginLoading: false | "anonymous" | "use-credentials" }`
- Default: `{ path: "dist", mode: "bundle", esVersion: "es2022", meta: false, chunkLoadingGlobal: "", preserveModules: false, preserveModulesRoot: "", crossOriginLoading: false }`

Output related configuration.

Expand All @@ -457,6 +504,8 @@ Output related configuration.
- `chunkLoadingGlobal`, global variable name for `chunk loading`
- `preserveModules`, whether to preserve the module directory structure (Bundless Only)
- `preserveModulesRoot`, preserve the root directory of the module directory structure (Bundless Only)
- `crossOriginLoading`, control the `crossorigin` attribute of the `script` tag and `link` tag for load async chunks
- `globalModuleRegistry`, whether enable shared module registry across multi entries

### optimization

Expand Down Expand Up @@ -495,6 +544,7 @@ Specify the plugins to use.
stats: {
startTime: number;
endTime: number;
...
};
}) => void;
load?: (filePath: string) => Promise<{ content: string, type: 'css'|'js'|'jsx'|'ts'|'tsx' }>;
Expand All @@ -508,6 +558,13 @@ JSHooks is a set of hook functions used to extend the compilation process of Mak
- `load`, used to load files, return file content and type, type supports `css`, `js`, `jsx`, `ts`, `tsx`
- `generateEnd`, called after Generate completes, `isFirstCompile` can be used to determine if it is the first compilation, `time` is the compilation time, and `stats` is the compilation statistics information

### progress

- Type: false | { progressChars: string }
- Default: { progressChars: "▨▨" }

Whether to display the build progress bar.

### providers

- Type: `Record<string, [string, string]>`
Expand Down Expand Up @@ -542,9 +599,16 @@ Buffer;

publicPath configuration. Note: There is a special value `"runtime"`, which means that it will switch to runtime mode and use the runtime `window.publicPath` as publicPath.

If you want to set the `publicPath` in the runtime, use `__mako_public_path__`. (Notice: `__webpack_public_path__` is also supported)

```ts
__mako_public_path__ = '/foo/';
```

### px2rem

- Type: `false | { root?: number, propBlackList?: string[], propWhiteList?: string[], selectorBlackList?: string[], selectorWhiteList?: string[], selectorDoubleList?: string[], minPixelValue?: number }`
- Type: `false | { root?: number, propBlackList?: string[], propWhiteList?: string[], selectorBlackList?: string[],
selectorWhiteList?: string[], selectorDoubleList?: string[], minPixelValue?: number, mediaQuery?: boolean }`
- Default: `false`

Whether to enable px2rem conversion.
Expand All @@ -556,6 +620,15 @@ Whether to enable px2rem conversion.
- `selectorWhiteList`, selector white list
- `selectorDoubleList`, selector double rem list
- `minPixelValue`,minimum pixel value, default is `0`
- `mediaQuery`,allow px to be converted in media queries, default is `false`

Among them, `selectorBlackList`, `selectorWhiteList` and `selectorDoubleList` all support passing regular expressions or strings, such as

```json
"selectorBlackList": [".a", "/.__CustomClass_/"]
```

> The string wrapped by the characters `/` will be parsed as a regular expression.
### react

Expand Down Expand Up @@ -661,6 +734,24 @@ Child configuration items:
- `clientComponentTpl`, client component template, use `{{path}}` to represent the path of the component, and use `{{id}}` to represent the id of the module.
- `emitCSS`, whether to output CSS components.

### sass

- Type: `Options<'async'>`
- Default: `{}`

> The "sass" package is not installed. Please run "npm install sass" to install it.
Specify the sass [configuration](https://sass-lang.com/documentation/js-api/interfaces/options/).


e.g.

```ts
{
"sourceMap": false
}
```

### stats

- Type: `{ modules: bool } | false`
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ It's suggested to ask questions on the [Github issue tracker](https://github.com

Or, join the WeChat Group(Commucation in Chinese) by scanning the QR code below:

<img src="https://mdn.alipayobjects.com/huamei_lpyngx/afts/img/A*NbqoQJB25dAAAAAAAAAAAAAADjjvAQ/original" width="120" />
<img src="https://mdn.alipayobjects.com/huamei_lpyngx/afts/img/A*4xXlQITJ2agAAAAAAAAAAAAADjjvAQ/original" width="120" />

Or, join the Telegram Group by clicking the link below:

Expand Down
Loading

0 comments on commit 26595ea

Please sign in to comment.