Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoaderOptionsPlugin #346

Open
dland512 opened this issue Jun 11, 2017 · 1 comment
Open

LoaderOptionsPlugin #346

dland512 opened this issue Jun 11, 2017 · 1 comment

Comments

@dland512
Copy link

dland512 commented Jun 11, 2017

Great webpack starter. Thanks for putting it together. Quick question for you. I see that it's using LoaderOptionsPlugin. I'm still a bit new to Webpack so there could be a good reason for it but I was wondering why we are going that route rather than just putting the config options in the loader declarations themselves. For example, for tslint-loader, doing this:

{
    test: /\.ts$/,
    loader: 'tslint-loader',
    options: {
        emitErrors: true,
        failOnHint: true
    }
}

Seems to work just as well as using the plugin:

new webpack.LoaderOptionsPlugin({
    options: {
        tslint: {
            emitErrors: true,
            failOnHint: true
       }
}

Again, this could very well be based on my not understanding something correctly, so I'm more just asking for the sake of learning.

@Foxandxss
Copy link
Member

supposedly the former way was deprecated in 2.0 and the latter is the recommended one. Not sure if that changed again over time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants