Skip to content

Commit

Permalink
docs(README): add webpack notes(refs #68) & tweaks [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
59naga committed Sep 28, 2018
1 parent 753d945 commit d0001d5
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.md
Expand Up @@ -70,7 +70,7 @@ Write the name to [babelrc](https://babeljs.io/docs/usage/babelrc/). It works wi

```json
{
"presets": ["env"],
"presets": ["@babel/env"],
"plugins": [
"add-module-exports"
]
Expand All @@ -84,7 +84,7 @@ this plugin makes changes only when exists `exports.default` (in other words, us

```json
{
"presets": [["env", {"modules": false}]],
"presets": [["@babel/env", {"modules": false}]],
"plugins": [
"add-module-exports"
]
Expand All @@ -100,6 +100,17 @@ export default 'foo'
`1.0.0` Currently support is `commonjs` and `umd`.
Doesn't support `amd`, `systemjs` modules(don't use. there are no plans to support at the moment).

### with Webpack

Likewise, webpack doesn't perform commonjs transformation for [codesplitting](https://webpack.js.org/guides/code-splitting/). Need to set commonjs conversion.

```js
module.exports = {
presets: [["@babel/env", { modules: "commonjs" }]],
plugins: ["add-module-exports"]
};
```

Options
---

Expand Down

0 comments on commit d0001d5

Please sign in to comment.