-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (25 loc) · 726 Bytes
/
Copy pathindex.js
File metadata and controls
30 lines (25 loc) · 726 Bytes
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 gulp = require('gulp')
const path = require('path')
const utils = require('./lib/utils')
const build = require('./lib/core/index')
const pluginLoader = require('./lib/core/plugin-loader')
let defaultConfig = {
extname: '.vue'
}
module.exports = async function (config) {
config = dealConfig(config)
await utils.remove(config.output)
await utils.mkdirs(config.output)
dealPlugins(config)
build(config)
}
function dealPlugins(config) {
pluginLoader.registerPlugin(config.plugins)
}
function dealConfig(c) {
c = Object.assign(defaultConfig, c)
c.enter = utils.getAbsolutePath(c.enter)
c.output = utils.getAbsolutePath(c.output)
c.enterFile = path.resolve(c.enter, `app${c.extname}`)
return c
}