If there is a custom block in vue file. E.g.
<router3333>
path: /:category/:segment
</router3333>
It will be compiled and work fine with vue loader configured as the only one in the .use clause 
If i add another loader into use clause that do exactly nothing for example whole loader
module.exports = function (source) { return source }
Compilation will fail with error
Module parse failed: Unexpected token (24:17)
File was processed with these loaders:
* ./my-loader.js
* ./node_modules/vue-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|
|
> path: /:category/:segment
The output of vue-loader in both cases is same
import { render, staticRenderFns } from "./xxxc.vue?vue&type=template&id=0067048f&" 01:13:55
import script from "./xxxc.vue?vue&type=script&lang=ts&"
export * from "./xxxc.vue?vue&type=script&lang=ts&"
/* normalize component */
import normalizer from "!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js"
var component = normalizer(
script,
render,
staticRenderFns,
false,
null,
null,
null
)
/* custom blocks */
import block0 from "./xxxc.vue?vue&type=custom&index=0&blockType=router3333"
if (typeof block0 === 'function') block0(component)
export default component.exports
So just adding an loader that do nothing in use clause make custom block fail. Whats happening here and how to avoid it ?
Here is repro https://codesandbox.io/s/codesandbox-nuxt-4dqmy If in nuxt.config set vuetify.treeShake: true - it will do what is described here, e.g. add another loader to use clause and it will cause error. The loader code itself doesn't matter as it happen with empty loader too.