runjuu/html-inline-css-webpack-plugin

Multi-entry setup

Juraj-Masiar opened this issue · 4 comments

Hello,

Is there a support for multi-entry html?
Right now I have multiple HtmlWebpackPlugin instances for each html file:

    plugins: [
      new MiniCssExtractPlugin({
        filename: '[name].css',
        chunkFilename: "[id].css"
      }),
      ...inputFiles.map(path => new HtmlWebpackPlugin({
        inject: true,
        chunks: [path],
        filename: `${path}.html`,
        template: `src/${path}.html`,
      })),
      new HTMLInlineCSSWebpackPlugin({
        leaveCSSFile: false,
      }),

But the injected CSS is not right because all html files contains all css tyles.

Hi @icl7126 , can you provide a minimal demo that can produce this issue?

Sure thing!
MultiEntryDemo.zip
Steps to reproduce:

  1. extract zip
  2. npm i
  3. npm run w
  4. check new folder target - it contains two folders with two html files - both files contains all css styles from both css files
    Also the <link href="../note/note.css" rel="stylesheet"> is still present before the actual inline style.

Hi @icl7126 , I fixed the issue at 1.7.0. Let me know if there is any problem

@runjuu Thank you!!! It works perfectly now!

Also it's nice to see I'm not the only one programming on Sunday :)