Skip to content

Commit

Permalink
docs: warn against having comments=false in babel (#244)
Browse files Browse the repository at this point in the history
It took me an hour+ to figure out why I wasn't getting chunk names in my stats file... turns out babel was stripping the comments injected by this plugin. It isn't immediately obvious how the plugin works, so I figured I'd save the next person some time and make a note here.
  • Loading branch information
mike-marcacci authored and gregberge committed Feb 19, 2019
1 parent e9f8eca commit 4a602f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions website/src/pages/docs/babel-plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ As you can see the "webpackChunkName" annotation is automatically added.

On client side, the two code are completely compatible.

Please note that babel must not be configured [to strip comments](https://babeljs.io/docs/en/options#comments), since the chunk name is defined in a comment.

## Loadable detection

The detection of a loadable component is based on the keyword "loadable". It is an opiniated choice, it gives you flexibility but it could also be restrictive.
Expand Down

0 comments on commit 4a602f7

Please sign in to comment.