Skip to content

Rendering components from when "public path" in webpack is set to different location #504

Answered by zablik
zablik asked this question in Help (Vue)
Discussion options

You must be logged in to vote

Well, I really hate to provide a solution without having a clear understanding WHY does it work exactly like this, but... here it is

in webpack.mix.js

mix
    .setPublicPath("public/core") // <----
    .setResourceRoot("/core") // <----
    .sass("resources/scss/style.scss", "/css") // <--- removed "/public" prefix
    .js("resources/js/app.js", "/js")  // <--- removed "/public" prefix

..............................

mix.webpackConfig({
    output: {
        publicPath: "/core/" // <----
    },
});

I tried to remove any of these fixes and it broke the app.
btw, without mix.setResourceRoot("/core") scripts and styles were working, but images weren't.

I wish someone explained the given be…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@claudiodekker
Comment options

Answer selected by claudiodekker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants