-
-
Notifications
You must be signed in to change notification settings - Fork 384
new URL() emits an extra blank css file #790
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
Comments
A temp workaround is using |
I am already using 5.2.7. But now I see 6.x.x is released, maybe I should try it? |
You should not use |
The fact that it "almost" works is encouraging. This plugin could be very versatile if it just cleaned up the empty file.
This is working just great for wp4, wp5, and es6 except the plugin is emitting that blank file when new URL is used. Also, as a side note, I've bumped css-loader to 6.2.0 and webpack to 5.45.1, still the same issue (but I don't see the "not playing nicely" manifesting itself). |
HI @RatherLogical thank you.Because i faced to same problem.
And I downgrade |
@GregNing Please create reproducible test repo |
You should not downgrade css-loader, it is very bad, only v6 will get fixes |
@alexander-akait I just create new issue and thank you. |
Original issues can be solved using module.exports = {
entry: "./index.js",
module: {
rules: [
{
test: /\.css$/,
use: [Self.loader, "css-loader"],
type: 'javascript/auto'
},
],
},
plugins: [
new Self({
filename: "[name].css",
}),
],
}; |
Expected Behavior
css should be extracted cleanly into a css bundle without emitting artifacts
Actual Behavior
css is extracted into bundle but a bogus css file is also emitted
Code
How Do We Reproduce?
Place the three files in an environment and build. You will get the following files in dist:
app.js
app.css (contains the correct, extracted css)
b88d04fba731603756b1.css (your hash may vary) which contains the following:
This is the bogus file.
The bogus file does not get emitted with a standard import
import "./src/test-new-url.css";
The text was updated successfully, but these errors were encountered: