I decided to try out WebPack on a new project I'm spinning up today and I'm getting really strange behavior from the sourcemaps. I can't find anything about it in the documentation, nor can I find anyone else having this issue when skimming StackOverflow.
I'm currently looking at the HelloWorld app produced by Vue-CLI's WebPack template -- no changes have been made to the code, the build environment, or anything.
I installed everything and ran it like so:
vue init webpack test && cd test && npm install && npm run dev
Looking at my sourcemaps, I see the following:
This is a hot mess. Why are there three version of HelloWorld.vue
and App.vue
? Worse yet, each version has a slightly different version of the code and none of them match the original source. The HellowWorld.vue
sitting in the root directory does match the original source, but what's it doing down there instead of in the ./src/components
folder? Finally, why isn't there a fourth App.vue
that has the original source for it?
As far as I can tell this may have something to do with the WebPack loaders. I've never gotten these kinds of issues with any other bundler, though. Below is an example of the exact same steps using the Browserify Vue-CLI template:
No webpack://
schema, only one copy of every file, the files actually contain the original source code (kind of important for source maps), no unexpected (webpack)/buildin
or (webpack)-hot-middleware
, no .
subdirectory,.... just the source code.
HelloWorld.vue
after a full page reload? – Midinettesource-map
,inline-source-map
,cheap-source-map
,inline-cheap-module-source-map
, andeval
. Although the source maps fromeval
were better, they still suffered a lot of the same issues, including have 3-4 versions of every source file. I'll try disabling hot reloading to see if that helps. – Revival