0

So my React Lazy setup works great, I use Laravel Mix instead of the normale Webpack config. But after running, the (named) chunks are all put in the public folder, instead of the public/js folder. The site works great, but just for organization I would love it if the chunked js files are in a separate js folder as the public folder will get crowded with all the chunks. Anyone know the answer? :)

1
  • Sorry, can you share config laravel mix for React Lazy Commented Dec 3, 2021 at 9:27

1 Answer 1

0

Wow. The answer was soooo easy. In Webpack.mix.js set the directory alongside the chunk name!

output: {
    chunkFilename: "js/[name].js",
},
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.