-
-
Notifications
You must be signed in to change notification settings - Fork 385
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
module.generator.asset.publicPath='/' throw error #872
Comments
Please fill out all fields |
https://github.com/ckken/webpack-boilerplate thanks reply |
Remove:
Yes says webpack to have auto public path and override it for CSS, it is not good |
It works without specifying the |
It is limitation due |
Maybe my example from here helps, as it seems the same issue: |
@ckken You should not use
Why? Because you can't combine |
@ldrick You example is more complex, you try to create relative URL inside
But in context of all styles, you can have other |
I have the same problem. How to solve it |
I have to chime in to say the loss of support for With
|
Can you provide full minimum configuration, we have some edge cases... want to investigate |
@alexander-akait {
module: {
rules: [
{
test: /\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/i,
type: 'asset/resource',
generator: {
publicPath: '//cdn.example.com/assets/',
}
},
],
},
} Here is a reproducible project: Just run
|
@scarletsky Yep, because it is wrong URL, please use
|
@alexander-akait Thanks for your reply. It seems the Just do these changes: // src/index.js
// import './index.css';
import url from './assets/webpack.svg';
console.log("Hello World!", url); // webpack.config.js
rules: [
{
test: /\.css$/i,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: '//cdn.example.com/assets/',
},
},
'css-loader'
],
},
{
test: /\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/i,
type: 'asset/resource',
},
] The
If we set |
|
Any updates? Still a blocking problem right now for us. |
Same for us, it worked in previous versions like a charm and now our Framework can't use publicPath anymore because of that limitation. How is it meant to use different runtime publicPaths for different resources then? BR, |
There is solution #915 |
It still does not work for me with v2.6.0. |
@s3curitybug Can you provide reproducible example? |
@s3curitybug you need to upgrade webpack to 5.70 also. |
I reduced my project to the minimum possible: This works with v2.3.0, but does not with newer ones (even with webpack 5.70). |
@alexander-akait I think this related to var ___CSS_LOADER_URL_IMPORT_0___ = new URL(
/* asset import */ __webpack_require__("asset/resource|/Users/ivankopeykin/Repositories/test-mini-css-extract-plugin/src/main/front/style/fonts/S6u8w4BMUTPHjxsAUi-qJCY.woff2")
, __webpack_require__.b); |
@vankop But we don't do nothing special in css-loader, just convert |
@alexander-akait yeah, I found a problem. |
should work with webpack/webpack#15613 |
It works after upgrading webpack 5.71.0 + mini-css-extract-plugin 2.6.0. My
But the output miss
|
@vankop Still buggy? |
hm.. with one leading slash works fine.. |
it works now for me :) |
Closing due to inactivity. Please test with latest version and feel free to reopen if still regressions. Thanks! |
Bug report
Actual Behavior
Expected Behavior
How Do We Reproduce?
The text was updated successfully, but these errors were encountered: