You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Babel is a compiler for writing next generation JavaScript.
@@ -81,6 +81,23 @@ module: {
81
81
}
82
82
```
83
83
84
+
or by using global options:
85
+
86
+
```javascript
87
+
module: {
88
+
loaders: [
89
+
{
90
+
test:/\.js$/,
91
+
exclude:/(node_modules|bower_components)/,
92
+
loader:'babel-loader'
93
+
}
94
+
]
95
+
},
96
+
babel: {
97
+
presets: ['es2015']
98
+
}
99
+
```
100
+
84
101
This loader also supports the following loader-specific option:
85
102
86
103
*`cacheDirectory`: Default `false`. When set, the given directory will be used to cache the results of the loader. Future webpack builds will attempt to read from the cache to avoid needing to run the potentially expensive Babel recompilation process on each run. If the value is blank (`loader: 'babel-loader?cacheDirectory'`) or `true` (`loader: babel-loader?cacheDirectory=true`) the loader will use the default cache directory in `node_modules/.cache/babel-loader` or fallback to the default OS temporary file directory if no `node_modules` folder could be found in any root directory.
0 commit comments