【发布时间】:2017-11-16 13:39:55
【问题描述】:
我正在使用 vue-styleguidist 为 VueJS 组件生成文档。
这通常工作得很好,但在这种情况下我得到一个错误:
./node_modules/vue-awesome/components/Icon.vue
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
<template>
<svg version="1.1"
:class="klass"
Learn how to add webpack loaders to your style guide:
https://github.com/vue-styleguidist/vue-styleguidist/blob/master/docs/Webpack.md
我的 vue-styleguidist 配置文件 (styleguide.config.js) 包含加载 webpack 文件的默认规则:
const loaders = require('vue-webpack-loaders');
module.exports = {
...
webpackConfig: {
module: {
loaders,
},
...
},
...
};
其他 .vue 文件加载正确,但 Icon.vue 加载不正确。
【问题讨论】:
标签: vuejs2 vue-component