-
Notifications
You must be signed in to change notification settings - Fork 20
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
link tag from HTML is not removed #29
Comments
I also experienced this issue. I'm using webpack 1.14.0 and extract-text-webpack-plugin 1.0.1 (meant for webpack1). @tahnik what versions do you use? |
@tahnik how do you configure loader? My (partial) config is: {
plugins: [
new HtmlWebpackPlugin(),
// This separates codebase into vendor.[hash].(css|js) and app.[hash].(css|js)
// Later I'd like to inline only vendor.[hash].css (for testing right now, later I'll try
// to find a way to create a subset of both I need inlined but that's not the point
// of this report. I just want to make it clear why I mention vendor.[hash].css in
// StyleExtHtmlWebpackPlugin cssRegExp below)
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks(module) {
return module.resource && module.resource.startsWith(
path.resolve(__dirname, 'node_modules')
);
},
}),
new StyleExtHtmlWebpackPlugin({
cssRegExp: /vendor\.[0-9a-f]+\.css/,
position: 'head-bottom',
}),
],
module: {
loaders: [
{
test: /\.(scss|sass)$/,
loader: ExtractTextPlugin.extract("style-loader", ['css-loader', 'postcss-loader', 'sass-loader'])
},
],
},
} This config makes It came to my mind that at least I use the plugin in a way it's not intended to be used: I try to inline a chunk that has already been injected as Although by doing this analysis I managed to solve my own case it seem to be different than what @tahnik describes. Nevertheless it's not emphasised enough in the documentation that tag will only be replaced if position is left to |
@jrencz I am using Webpack 2.4.1 and style-ext-html-webpack-plugin 3.4.1 By the way, you can try removing style loader from your loader to see if it makes any difference. |
Style loader will be required in my case since I want one of chunks to be represented as yet I wouldn't like to create 2 distinct loader configurations |
I also have this problem. |
Same issue here. Here is my webpack config. I just inline all CSS into the single html file. @numical do you have any ideas what is the reason for such behaviour? I am not a pro webpack user, but want to try to fix the issue. |
I have met same issues. @jrencz did you already fix that? |
@zzsanduo nope. I gave up and I decided to go back to that when I'll have some Webpack config maintenance planned |
@numical any advice on how to remove the |
Hi, Looked at this today at work. Seems the issue is to do with the file path searched for. HtmlWebpackPlugin appends the public path to the asset url (e.g. ../../../) in the src when including but StyleExtWebpackPlugin doesn't use this when searching for the link tag the second time, this is why its not replaced only added. |
Additional comments: Line 15 of replaceTag.js in this plugin uses compilation.outputOptions.publicPath whereas line 394 in index.js of HtmlWebpackPlugin uses var publicPath = typeof compilation.options.output.publicPath !== 'undefined' |
Fixed in v3.4.2 thanks to @ballwood |
This maybe a more of a question then a bug. I have this:
As far as I understand, once converting the link to style, it should remove the relevant link tag. But it is not doing that. It is still keeping the link that. It is not creating any main_external.css in the build folder.
The text was updated successfully, but these errors were encountered: