Skip to content

Commit

Permalink
Add .mjs to the examples
Browse files Browse the repository at this point in the history
See babel#683 for details.
  • Loading branch information
philipwalton committed Sep 21, 2018
1 parent 8f240b4 commit 5e149e6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -45,7 +45,7 @@ Within your webpack configuration object, you'll need to add the babel-loader to
module: {
rules: [
{
test: /\.js$/,
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
Expand All @@ -68,7 +68,7 @@ You can pass options to the loader by using the [`options`](https://webpack.js.o
module: {
rules: [
{
test: /\.js$/,
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
Expand Down Expand Up @@ -96,7 +96,7 @@ This loader also supports the following loader-specific option:

### babel-loader is slow!

Make sure you are transforming as few files as possible. Because you are probably matching `/\.js$/`, you might be transforming the `node_modules` folder or other unwanted source.
Make sure you are transforming as few files as possible. Because you are probably matching `/\.m?js$/`, you might be transforming the `node_modules` folder or other unwanted source.

To exclude `node_modules`, see the `exclude` option in the `loaders` config as documented above.

Expand All @@ -119,7 +119,7 @@ rules: [
// the 'transform-runtime' plugin tells Babel to
// require the runtime instead of inlining it.
{
test: /\.js$/,
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
Expand Down Expand Up @@ -183,7 +183,7 @@ require('./app');
If you receive this message, it means that you have the npm package `babel` installed and are using the short notation of the loader in the webpack config (which is not valid anymore as of webpack 2.x):
```javascript
{
test: /\.js$/,
test: /\.m?js$/,
loader: 'babel',
}
```
Expand All @@ -194,7 +194,7 @@ To fix this, you should uninstall the npm package `babel`, as it is deprecated i
In the case one of your dependencies is installing `babel` and you cannot uninstall it yourself, use the complete name of the loader in the webpack config:
```javascript
{
test: /\.js$/,
test: /\.m?js$/,
loader: 'babel-loader',
}
```
Expand Down

0 comments on commit 5e149e6

Please sign in to comment.