mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 18:32:22 +00:00
docs(module-loader): fix typo
This commit is contained in:
parent
7b8c0632f6
commit
a841acdca5
@ -482,7 +482,7 @@ import { method } from 'commonjs-package';
|
|||||||
|
|
||||||
加载单一的输出项,可以写成下面这样。
|
加载单一的输出项,可以写成下面这样。
|
||||||
|
|
||||||
```bash
|
```javascript
|
||||||
import packageMain from 'commonjs-package';
|
import packageMain from 'commonjs-package';
|
||||||
const { method } = packageMain;:w
|
const { method } = packageMain;:w
|
||||||
```
|
```
|
||||||
@ -523,7 +523,7 @@ export const foo = cjsModule.foo;
|
|||||||
|
|
||||||
另一种做法是在`package.json`文件的`exports`字段,指明两种格式模块各自的加载入口。
|
另一种做法是在`package.json`文件的`exports`字段,指明两种格式模块各自的加载入口。
|
||||||
|
|
||||||
```bash
|
```javascript
|
||||||
"exports":{
|
"exports":{
|
||||||
"require": "./index.js",
|
"require": "./index.js",
|
||||||
"import": "./esm/wrapper.js"
|
"import": "./esm/wrapper.js"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user