加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
styleguide.config.js 1.98 KB
一键复制 编辑 原始数据 按行查看 历史
露露淘气包 提交于 2020-07-24 18:20 . 添加gif图
const {VueLoaderPlugin} = require('vue-loader')
const path = require('path')
const glob = require('glob')
const sections = (() => {
const docs = glob
.sync('docs/*.md')
.map(p => ({name: path.basename(p, '.md'), content: p}))
const demos = []
let faq = '' // 约定至多只有一个faq.md
const guides = []
docs.forEach(d => {
if (/^faq$/i.test(d.name)) {
d.name = d.name.toUpperCase()
faq = d
} else if (/^guide-/.test(d.name)) {
guides.push(d)
} else {
demos.push(d)
}
})
return [
{
name: 'Components',
components: 'src/*.vue',
usageMode: 'expand'
},
{
name: 'Demo',
sections: demos,
sectionDepth: 2
},
...(faq ? [faq] : []),
...(guides.length ? [{name: 'Guide', sections: guides, sectionDepth: 2}] : [])
]
})()
module.exports = {
styleguideDir: 'docs',
pagePerSection: true,
ribbon: {
url: 'https://github.com/FengZeming/vue-el-upload'
},
require: [
'./styleguide/element.js'
],
sections,
webpackConfig: {
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader']
},
{
test: /\.less$/,
loaders: ['vue-style-loader', 'css-loader', 'less-loader']
},
{
test: /\.(woff2?|eot|[ot]tf)(\?.*)?$/,
loader: 'file-loader'
}
]
},
plugins: [new VueLoaderPlugin()],
devServer: {
open: true,
overlay: {
warnings: false,
errors: true,
},
proxy: {
'/dev-api': {
// target: 'http://netcar.ysdcar.com/net_car/pc',
target: 'http://localhost:3000/',
pathRewrite: {
'^/dev-api': '',
},
secure: false,
changeOrigin: true,
},
},
},
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化