-
-
Notifications
You must be signed in to change notification settings - Fork 387
publicPath not doing anything #403
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
Please create minimum reproducible test repo, i think you have invalid configuration |
I also have this issue my code is here:
Any advice would be awesome. |
Have the same issue! When file-loader has specified puplicPath option, publicPath in MiniCssExtractPlugin.loader does nothing, when I remove file-loader's publicPath everything works fine |
Please create minimum reproducible test repo |
I just had the same problem and found a fix when I came across this comment The readme says To get it to work, just add the relative path in the
and make sure your webpack output options's path is set to this (i included publicPath and filename for completeness):
publicPath in MiniCssExtractPlugin options is still ignored....but at least this is a working workaround for now. |
Thank you! I will try and let you know how it goes!
…On Sat, Sep 7, 2019 at 12:58 PM Boro Vukovic ***@***.***> wrote:
I just had the same problem and found a fix when I came across this
comment
<#137 (comment)>
The readme says Options similar to the same options in
webpackOptions.output which makes us believe we can have similar options
(path, publicPath, etc.)....which is WRONG.
To get it to work, just add the relative path in the filenam option like
this:
new MiniCssExtractPlugin({
filename: 'public/css/main.bundle.css'
}),
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#403?email_source=notifications&email_token=ABQTZCNJSXPDSVR6TD4UGHLQIQBXPA5CNFSM4HPUSUF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6FBFGA#issuecomment-529142424>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQTZCPY34Q4AYMTU3XZ7LDQIQBXPANCNFSM4HPUSUFQ>
.
|
Any update on this? publicPath is useless right now. It is executed, but its value is never used. If it is supposed to be used in a different way, please update docs with a clear example about its usage. Thanks. |
Also trying to use 'publicPath' but it doesn't work right now |
Not working for me either. |
My version is Configuration here.
|
Ooops, my problem was solved accidentally... I found that my |
Wow that's interesting, thanks for sharing. I still couldn't get it to work.
…On Sun, Sep 29, 2019 at 12:28 AM Kaida Lin ***@***.***> wrote:
Ooops, my problem was solved accidentally... I found that my router
missing a property named path (works like ouput.publicPath I think).
After then, I try to change the value of loaders.options.publicPath and
it works!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#403?email_source=notifications&email_token=ABQTZCNHQD52HC2ET3DFCSDQMBKLNA5CNFSM4HPUSUF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD73LKZI#issuecomment-536261989>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQTZCIJI7XBNILPENIYNDDQMBKLNANCNFSM4HPUSUFQ>
.
|
Despite I landed here for the same reason described by @HoldYourWaffle, now that I've better read the docs of both What we're currently expecting from the In a few words what we wanted here is output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
},
plugins: [
new MiniCssExtractPlugin({
// path relative to the output.path
// e.g. assets/style/main.css => dist/assets/style/main.css
filename: 'assets/style/[name].css',
})
], |
Thanks for the explanation @alessiofachechi, it took my quite a while to figure this out. Hopefully someone can update the documentation with an example. |
But wouldn't it be useful to have |
These are the workarounds: 👇 |
It is not bug, it is misleading, |
This might be related to #222.
Expected Behavior
publicPath
should overwrite the output directory specified inoutput.path
Actual Behavior
Using
publicPath
doesn't seem to do anything. If it's defined as a function it does get called, but the return value is never used.Code
Full config
How Do We Reproduce?
By using the configuration above.
The text was updated successfully, but these errors were encountered: