webdiscus / pug-plugin

Renders Pug template to HTML or template function. Resolves source files of scripts, styles, images in Pug . Uses Pug template as entry point.
https://webdiscus.github.io/pug-plugin/hello-world
ISC License
74 stars 8 forks source link

pug-plugin warning by usage script or style in entry #40

Closed webdiscus closed 2 years ago

webdiscus commented 2 years ago

That test repo isn't up anymore.. Can the solution be shared here by any chance? I'm having the same issue:

image

@webdiscus @yashiel

Originally posted by @perry-mitchell in https://github.com/webdiscus/pug-plugin/issues/37#issuecomment-1232550864

webdiscus commented 2 years ago

Hi @perry-mitchell,

this is not a bug, this is the feature.

In many projects is used the pug-plugin wrong. If you see this warning, then is used html-webpack-plugin and/or mini-css-extract-plugin. If is used html-webpack-plugin and/or mini-css-extract-plugin, then pug-plugin should not be used. To avoid misuse was added this warning. This warning is harmless.

In README.md:

Warning Don't use the pug-plugin together with html-webpack-plugin and mini-css-extract-plugin. The pug-plugin is designed to replace these plugins to make Pug easier to use and faster to compile.

Are scripts or styles defined in the Webpack entry?

P.S. If you want use html-webpack-plugin and/or mini-css-extract-plugin in Webpack config, then use them with a pug-loader instead of the pug-plugin.

webdiscus commented 2 years ago

@perry-mitchell,

in v4.3.0 the Warning (for correct usage of pug-plugin) is removed. This has no side effect.