Html-webpack-plugin: [html-webpack-inline-source-plugin] is not working with [[email protected] version+]

Created on 30 Mar 2020  路  8Comments  路  Source: jantimon/html-webpack-plugin

see this issue : https://github.com/DustinJackson/html-webpack-inline-source-plugin/issues/75

can not read property "tapAsync" from undefined

@jantimon
Have you considered building the functionality of inlineSource into html-webpack-plugin?

wontfix

Most helpful comment

Meanwhile, the similar plugin react-dev-utils/InlineChunkHtmlPlugin can be used as a replacement.

npm install --save-dev react-dev-utils
import HtmlPlugin from "html-webpack-plugin"
import InlineChunkHtmlPlugin from "react-dev-utils/InlineChunkHtmlPlugin"

const webpackConfig = {
  plugins: [
    new HtmlPlugin({
      title: "App",
      meta: {},
    }),
    new InlineChunkHtmlPlugin(HtmlPlugin, [/\.(js|css)$/]),
  ],
}

It works well in general, but it isn't suitable for me because unlike html-webpack-inline-source-plugin it does not support inlining CSS, only JS, so I'll wait for upcoming alternatives.

All 8 comments

Is there any information from @DustinJackson if he want's to upgrade?

@jantimon ......
html-webpack-inline-source-plugin. has over 3 years ago...

In some cases, it is more desirable to maintain this feature by the official. At least embedding the css directly in the head of the html page is a very good performance optimization practice.

I'm currently using html-webpack-inline-source-plugin@beta, but that project doesn't seem to be maintained. +1 for including something like that plugin directly in html-webpack-plugin.

Is there any information from @DustinJackson if he want's to upgrade?

@jantimon I'll take a look this weekend to get it working with latest, I'll open an issue to see if anybody else wants to help maintain it

@jantimon hope include this feature with html-webpack-plugin

DustinJackson/html-webpack-inline-source-plugin is deprecated now, so it would probably be the best to make it an official feature now.

Meanwhile, the similar plugin react-dev-utils/InlineChunkHtmlPlugin can be used as a replacement.

npm install --save-dev react-dev-utils
import HtmlPlugin from "html-webpack-plugin"
import InlineChunkHtmlPlugin from "react-dev-utils/InlineChunkHtmlPlugin"

const webpackConfig = {
  plugins: [
    new HtmlPlugin({
      title: "App",
      meta: {},
    }),
    new InlineChunkHtmlPlugin(HtmlPlugin, [/\.(js|css)$/]),
  ],
}

It works well in general, but it isn't suitable for me because unlike html-webpack-inline-source-plugin it does not support inlining CSS, only JS, so I'll wait for upcoming alternatives.

This issue had no activity for at least half a year. It's subject to automatic issue closing if there is no activity in the next 15 days.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lonelydatum picture lonelydatum  路  3Comments

hp8wvvvgnj6asjm7 picture hp8wvvvgnj6asjm7  路  3Comments

NeverwinterMoon picture NeverwinterMoon  路  3Comments

mmjamal picture mmjamal  路  3Comments

laruiss picture laruiss  路  3Comments