sebastiandedeyne / v1.sebastiandedeyne.com

My personal website
https://sebastiandedeyne.com
60 stars 19 forks source link

Fix small syntax error in code-splitting post #57

Closed Elhebert closed 6 years ago

Elhebert commented 6 years ago

I removed the leading / from the webpackChunkName, two reasons:

  1. It'll match the source that you distribute with the article (see: https://github.com/sebastiandedeyne/code-splitting-with-laravel-mix/blob/master/resources/assets/js/app.js#L6)
  2. it doesn't work with the /. I haven't check deep enough, but it seemds that webpack (or Mix) add a leading / no matter what, thus resulting in the browser trying to load //js/my-component.js instead of /js/my-component.js

Great articel by the way!

sebastiandedeyne commented 6 years ago

Leading slashes always confuse me with Webpack 😅 Thanks!

Elhebert commented 6 years ago

Webpack as a whole confuse me 😬