banderovskyi's avatar

Folder name is not passed to chunck path.

I need to setup mix to work with two different react js bundles. I've done it like this:

mix.js("resources/js/app-admin.js", "/admin/")
    .js("resources/js/app.js", "/")
    .setPublicPath("public/assets")
    .react()
    .version()
    .sourceMaps()
    .webpackConfig({
        resolve: {
            alias: aliases,
            extensions: [".tsx", ".ts", ".js"],
        },
        output: {
            publicPath: generatePublicAssetsPath(),
            chunkFilename: "[name].js?id=[chunkhash]",
        },

As a result of the build, I have two files one is /app.js and /admin/app-admin.js.

However, I use React Lazy which creates chunks. And I get fine paths for chunks for the app.js file. Whereas for app-admin.js my chunks are loaded not to /admin/ folder but to the same level as app.js.

Is there a way to configure my chunks for admin to be loaded to my /admin/ folder?

0 likes
0 replies

Please or to participate in this conversation.