Description
Version
15.2.4
Reproduction link
https://gitlab.com/ovenwand/VueLoaderBug
Steps to reproduce
- Run
npm install
to install all the build dependencies - Run
npm start
to run webpack-dev-server - See the error in your console.
What is expected?
The SFC should be passed to the custom loader which should do all kinds of beautiful magic (what the loader does is unrelated).
What is actually happening?
The SFC is always passed to vue-loader first, and as soon as the SFC is passed to vue-loader an error is thrown:
Module build failed (from ./node_modules/vue-loader/lib/index.js):
TypeError: Cannot read property 'content' of undefined
Which happens because it tries to load the src
as a Custom Block even though it is really just a plain old SFC without any additives.
Use case (not included with the repo): I am trying to parse some example blocks, which use the src
property to load an SFC. Inside the loader I register the component and pass the source to another component. I do this in a similar way as VueMaterial does (https://github.com/vuematerial/vue-material/blob/dev/build/loaders/component-example-loader.js).
I've tried messing with my webpack configuration, none of my attempts have succeeded to achieve my goal (I can elaborate if needed, long story...).