vux-loader icon indicating copy to clipboard operation
vux-loader copied to clipboard

bug fix: Each "*.vue" file is loaded twice in runtime. The root reaso…

Open stuartZhang opened this issue 5 years ago • 1 comments

bug fix: Each "*.vue" file is loaded twice in runtime. The root reason is that the same ".vue" file is referenced twice with different ref path.

  • The 1st ref path: ./node_modules/babel-loader/lib/index.js!./node_modules/vux-loader/src/script-loader.js!./node_modules/vux-loader/src/script-loader.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/VuxDemo.vue
  • The 2nd ref path: ./node_modules/babel-loader/lib/index.js!./node_modules/vux-loader/src/script-loader.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/VuxDemo.vue

As you see, there are two ref paths for the identical "*.vue" file (e.g. ./src/components/VuxDemo.vue). What's worse, there are two fragments "!./node_modules/vux-loader/src/script-loader.js" in the first one, which is erroneous and brings about the module-cache failure.

My change fixes it.

stuartZhang avatar Feb 10 '19 06:02 stuartZhang

The usage environment of my project:

  • Webpack 4
  • Babel 7
  • Vue 2.5.18

stuartZhang avatar Feb 10 '19 06:02 stuartZhang