MiniCssFile emits `=` symbol to the end of the url
See original GitHub issue- Operating System: MacOs bleeding edge
- Node Version: 12.10.0
- NPM Version: 6.10.3
- webpack Version: 4.46.0
- mini-css-extract-plugin Version: 1.3.6
Expected Behavior
Hashes on included resources in css (e.g. url(font)) should be the same inside css and js file
Actual Behavior
css files has this hash
src:url(https://static.pychat.org/font/fontello.eot?21a4cc50be58c1
f0d8b8941292120311=)
js file has this hash
/font/fontello.eot?21a4cc50be58c1f0d8b8941292120311
Code
To reproduce we need
- To pass
publicPath
to MiniCssExtractPlugin options that is an absolute url - on fileLoader add name which has
[contenthash]
in it
// webpack.config.js
module: {
rules : [
{
test: /\.sass$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
publicPath: "https://static.pychat.org"
},
'css-loader',
sassOptionsGlobal,
]
}
]
}
How Do We Reproduce?
git clone https://github.com/akoidan/pychat
cd pychat
git checkout a8d6d3c3575674c35c12e167cd40e908a451f36c
cd frontend
cp pychat.org.json production.json
nvm use
yarn install
yarn prod
cat dist/sw.js # check asssets. e.g. fontello.woff2 /font/fontello.woff?214a56
cat dist/main.css # check asssets. e.g. fontello.woff2. in my repo it's url(https://static.pychat.org/font/fontello.woff?214a563509566562229f1193074cf803=) format("woff")
Tips:
If I remove public path option from extractminicss plugin this =
symbol is no longer present
P.S> webpack config is located in builder.js
The diversion from origin source causes a lot of issues in service worker, since I rely that file assets should be the same.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
url() - CSS: Cascading Style Sheets - MDN Web Docs
The url() CSS function is used to include a file. The parameter is an absolute URL, a relative URL, a blob URL, or...
Read more >MiniCssExtractPlugin - webpack
If true, emits a file (writes a file to the filesystem). If false, the plugin will extract the CSS but will not emit...
Read more >10 Helpful VS Code Extensions for HTML & CSS - YouTube
Visual Studio Code has quickly become the code editor of choice among many developers. The vast extension library is one of its main...
Read more >How to Bundle a Simple Static Site Using Webpack - SitePoint
And webpack will create a bundle.js file in the dist folder. ... Then click and hold the reload symbol next to the address...
Read more >The complete best practices for minifying CSS - LogRocket Blog
Minifying CSS files is more nuanced than you might think at first. Learn the various minification tools, how to determine and remove unused ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yep, comment
optimize-css-assets-webpack-plugin
plugin in yourbuilder.js
script and all works fine,optimize-css-assets-webpack-plugin
uses cssnano under the hood (so bug incssnano
), there is good and bad news: good - I am main maintainer of cssnano, bad - I don’t have time and money to continue work on cssnano 😞 I understand it is not your problem, but if you send a PR I will look at thisBug here https://github.com/cssnano/cssnano/blob/master/packages/postcss-normalize-url/src/index.js#L15,
normalize-url
adds=
, debug:maybe we should open an issue in
normalize-url
package, I think nothing to fix hereLet’s close, nothing to fix here