[Vuejs]-Vue 2 + Webpack common imports work for one app but fail for another

0👍

If anyone ends up here, make sure that your html includes the webpacked chunk-common.js as a script. I had both the apps individual js files included and the chunk-vendors.js but, when including the mixins in both apps, the whole @mixins folder was extracted out into common where it was no longer available. Surprisingly, the failure was completely silent where I would usually expect a browser console error of some kind.

The source of this problem was a little obfuscated because some of the other folders with shared scripts (@utilities and @state) continued to work despite the missing common script. I can’t explain that other than webpack didn’t extract those out into common because they were too small perhaps? Anyway, make sure to check your webpack basics. Hope this helps at least one person because it was just a time sink for me.

Leave a comment