Skip to content

Commit

Permalink
Merge pull request #3 from webpack/master
Browse files Browse the repository at this point in the history
1116
  • Loading branch information
xp44mm authored Nov 16, 2020
2 parents dadf1f8 + 4646848 commit 485bb6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/content/guides/build-performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ W> Don't use too many workers, as there is a boot overhead for the Node.js runti
Enable persistent caching with the `cache-loader`. Clear cache directory on `"postinstall"` in `package.json`.


T> We support yarn PnP version 3 [`yarn 2 berry`](https://next.yarnpkg.com/features/pnp) for persistent caching
T> We support yarn PnP version 3 [`yarn 2 berry`](https://next.yarnpkg.com/features/pnp) for persistent caching.

### Custom plugins/loaders

Expand Down Expand Up @@ -153,7 +153,7 @@ Be aware of the performance differences between the different `devtool` settings
- The `cheap-source-map` variants are more performant if you can live with the slightly worse mapping quality.
- Use a `eval-source-map` variant for incremental builds.

=> In most cases, `eval-cheap-module-source-map` is the best option.
T> In most cases, `eval-cheap-module-source-map` is the best option.


### Avoid Production Specific Tooling
Expand Down
6 changes: 3 additions & 3 deletions src/content/guides/ecma-script-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import theDefaultValue from './module.js';

By default webpack will automatically detect whether a file is an ESM or a different module system.

Node.js estabilished a way of explicitly setting the module type of files by using a property in the `package.json`.
Node.js established a way of explicitly setting the module type of files by using a property in the `package.json`.
Setting `"type": "module"` in a package.json does force all files below this package.json to be ECMAScript Modules.
Setting `"type": "commonjs"` will instead force them to be CommonJS Modules.

Expand All @@ -75,11 +75,11 @@ Setting `"type": "commonjs"` will instead force them to be CommonJS Modules.

In addition to that, files can set the module type by using `.mjs` or `.cjs` extension. `.mjs` will force them to be ESM, `.cjs` force them to be CommonJs.

In DataURIs using the `text/javascript` or `application/javascript` mimetype will also force module type to ESM.
In DataURIs using the `text/javascript` or `application/javascript` mime type will also force module type to ESM.

In addition to the module format, flagging modules as ESM also affect the resolving logic, interop logic and the available symbols in modules.

Imports in ESM are resolved more stictly. Relative requests must include a filename and file extension.
Imports in ESM are resolved more strictly. Relative requests must include a filename and file extension.

T> Requests to packages e.g. `import "lodash"` are still supported.

Expand Down

0 comments on commit 485bb6f

Please sign in to comment.