hally9k
hally9k

Reputation: 2593

How to configure pre loader in Webpack 2.1.0 beta 23

Having just upgraded Webpack to 2.1.0 beta 25 I have been unable to find any guidance on how to configure pre loaders. The beta 23 release notes mention the depreciation of preloaders but the explanation of the replacement functionality leaves me a little lost. Where do I configure the enforcement?

removed postLoaders and preLoaders

rules enforce: "left" and enforce: "right" can be used instead.

My use case is just running the eslint loader before the .js transpilation step.

Upvotes: 1

Views: 430

Answers (1)

jaylynch
jaylynch

Reputation: 336

It seems left and right were too confusing, if you look at v2.1.0-beta.24 they've now renamed it to pre and post, which make a lot more sense. https://github.com/webpack/webpack/releases/tag/v2.1.0-beta.24

An example of what would have been an ESLint preLoader in the past:

module: {
  loaders: [
    {
      test: /\.jsx?$/,
      loader: 'eslint',
      exclude: /(node_modules)/,
      enforce: 'pre'
    },
    ...
  ]
}

Upvotes: 2

Related Questions