Skip to content

Commit b37e7ca

Browse files
authored
fix: add route-meta block loader to avoid vue-loader error (#27)
1 parent 6e82c90 commit b37e7ca

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,13 @@ module.exports = (api, options) => {
1818
webpackConfig
1919
.plugin('vue-auto-routing')
2020
.use(VueAutoRoutingPlugin, [pluginOptions])
21+
22+
// prettier-ignore
23+
webpackConfig.module
24+
.rule('route-meta')
25+
.post()
26+
.resourceQuery(/blockType=route-meta/)
27+
.use('route-meta')
28+
.loader('vue-cli-plugin-auto-routing/route-meta-loader')
2129
})
2230
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "Vue CLI plugin that provides auto routing feature",
55
"files": [
66
"index.js",
7+
"route-meta-loader.js",
78
"generator"
89
],
910
"repository": {

route-meta-loader.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = function() {
2+
return ''
3+
}

0 commit comments

Comments
 (0)