Skip to content

htmlLoader property not allowed in webpack >= v2.0.0 configs #135

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

Closed
nevcos opened this issue Jul 18, 2017 · 2 comments
Closed

htmlLoader property not allowed in webpack >= v2.0.0 configs #135

nevcos opened this issue Jul 18, 2017 · 2 comments
Milestone

Comments

@nevcos
Copy link

nevcos commented Jul 18, 2017

I'm submitting a bug report

Webpack version:
3.3.0

HTML-Loader version:
0.4.5

Please tell us about your environment:
Windows 10 + Node 6.11.0 + NPM 5.3.0

Current behavior:
Using htmlLoader property as described on docs give the following error when calling webpack:

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration has an unknown property 'htmlLoader'. These properties are valid:

Expected/desired behavior:
Because webpack no longer accepts properties not from webpack schema, the docs should be updated to use webpack.LoaderOptionsPlugin:

plugins: [
  new webpack.LoaderOptionsPlugin({
    options: {
      htmlLoader: {
       minimize: true
      }
    }
  })
]

More information here: https://stackoverflow.com/a/43135993/198787

@michael-ciniawsky
Copy link
Member

This will likely be removed in #134 (v1.0.0) and options.minimize will work this way then

{
   test: /\.html$/,
   use: { 
     loader: 'html-loader', 
     options: { minimize: {...options} }
  }
}

Meanwhile the usage of LoaderOptionsPlugin is the correct way, but it's usage is discouraged as it was mainly meant as a migration path between webpack v1 => webpack v2 in the early days of webpack v2 :)

@michael-ciniawsky michael-ciniawsky changed the title htmlLoader property not allowed on webpack 2 config (docs issue) htmlLoader property not allowed in webpack >= v2.0.0 configs Jul 18, 2017
@michael-ciniawsky
Copy link
Member

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

No branches or pull requests

2 participants