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
These functions are now always asynchronous instead of calling their callback sync if the chunk is already loaded.
232
233
234
+
## Loader configuration is through `options`
235
+
236
+
You can *no longer* configure a loader with a custom property in the `webpack.config.js`. It must be done through the `options`. The following configuration with the `ts` property is no longer valid with webpack 2:
237
+
238
+
```js
239
+
module.exports= {
240
+
...
241
+
module: {
242
+
use: [{
243
+
test:/\.tsx?$/,
244
+
loader:'ts-loader'
245
+
}]
246
+
},
247
+
// does not work with webpack 2
248
+
ts: { transpileOnly:false }
249
+
}
250
+
```
251
+
252
+
### What are `options`?
253
+
254
+
Good question. Well, strictly speaking it's 2 possible things; both ways to configure a webpack loader. Classically `options` was called `query` and was a string which could be appended to the name of the loader. Much like a query string but actually with [greater powers](https://github.com/webpack/loader-utils#parsequery):
But it can also be a separately specified object that's supplied alongside a loader:
269
+
270
+
```js
271
+
module.exports= {
272
+
...
273
+
module: {
274
+
use: [{
275
+
test:/\.tsx?$/,
276
+
loader:'ts-loader'
277
+
options: { transpileOnly:false }
278
+
}]
279
+
}
280
+
}
281
+
```
282
+
233
283
## `LoaderOptionsPlugin` context
234
284
235
285
Some loaders need context information and read them from the configuration. This need to be passed via loader options in long-term. See loader documentation for relevant options.
0 commit comments