<route-meta> loader
rozklad opened this issue ยท 15 comments
Hi,
i really love your plugin for vue cli. There's one thing i've noticed when using <route-meta>
custom block.
When using this custom block, it logically does not have loader registered for it so it throws error such as:
Module parse failed: Unexpected token
You may need an appropriate loader to handle this file type.
I came up with a dirty workaround, basically passing the <route-meta>
to a custom loader that does not do anything, like this:
# vue.config.js
module.exports = {
chainWebpack: config => {
config.module
.rule('routeMeta')
.resourceQuery(/blockType=route-meta/)
.type('javascript/auto')
.use('routeMeta')
.loader('routemeta.js');
}
}
Did i miss something in the installation? Is there a cleaner way to handle this?
This is because vue-loader always load custom blocks as JS content even if there are no corresponding loaders. I guess this is an issue of vue-loader.
Hello,
First of all, this is absolutely amazing plugin but I still struggling to fix this issue! Is there any new updates?
Thanks a lot
Is there any chance that this could be moved from the <route-meta>
element to the component properties (like that of the layout). I.e.
<script>
export default {
name: 'about',
layout: 'auth',
route_meta: { auth: true }
}
</script>
I feel this would look and handle much nicer.
The reason of <route-meta>
is described here. ktsn/vue-route-generator#1 (comment)
This should be fixed in vue-loader v15.6.3.
I have vue-loader 15.7.1 and I still get this error. I also tried above and still got the error.
I too am on vue-loader 15.7.1 and I still get this error - is there any additional info?
On 15.7.2 myself and am running into the same problem
Also
also
Any ETA for a fix?
It's already fixed... https://github.com/ktsn/vue-cli-plugin-auto-routing/releases/tag/v0.3.2
@ktsn - that's in the CLI, not in the normal package - I cannot use the CLI variant because I'm using Laravel-Mix
I get this is the wrong repo, but I'm getting ponged from repo to repo ๐
Then you can add dummy loader by yourself as OP stated.
I tried, didn't fix it... maybe Laravel-Mix isn't taking my loader into account even...