-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.f2econfig.js
29 lines (28 loc) · 928 Bytes
/
.f2econfig.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const path = require('path')
const mdppt = require('mdppt')
mdppt.cfg.base = '/assets/'
module.exports = {
livereload: true,
gzip: true,
buildFilter: (pathname) => {
return !/^node_modules/.test(pathname) || /^node_modules\/mdppt\//.test(pathname)
},
middlewares: [
// mdppt 编译
(conf) => {
return {
onSet(pathname, data, store) {
if (pathname.match(/\.md$/)) {
let res = mdppt(data.toString())
// 在数据仓库中设置一个新的资源 .html
store._set(pathname.replace(/\.md$/, '.html'), res)
}
},
outputFilter (pathname, data) {
// .md 资源开发环境可见, 但是不输出
return !/\.md$/.test(pathname)
}
}
}
]
}