Laravel Mix webpack chunks files loaded from wrong path

Viewed 467

I have a custom webpack script since I need to manage a custom output for admin panel and keep public site with its own public files.

I have this setting:

mix.setPublicPath('public/admin')
    .setResourceRoot('/admin')


mix.webpackConfig({
    output: {
        chunkFilename: 'js/chunks/[name].js',
    }
});

The chunk files are correctly generated on admin/js/chunks folder, but when I load the page, the app is trying to load chunk files from "public/js/chunks" which is the default place.

I tried defining: publicPath: '/admin/', but doesn't work.

Any idea? Thanks.

0 Answers
Related