2019-07-03 18:56:55 +08:00
|
|
|
const { copyDir, fileForEach, readFile } = require('./plugin/fs')
|
|
|
|
const print = require('./plugin/print')
|
|
|
|
const path = require('path')
|
2019-07-03 18:32:59 +08:00
|
|
|
|
|
|
|
const PACKAGE_SRC = './src'
|
|
|
|
const COMPILE_SRC = './lib'
|
|
|
|
|
|
|
|
async function start () {
|
|
|
|
const copyPackage = await copyDir(PACKAGE_SRC, COMPILE_SRC)
|
|
|
|
|
|
|
|
if (!copyPackage) {
|
|
|
|
print.error('Exception in copyPackage!')
|
|
|
|
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2019-07-03 18:56:55 +08:00
|
|
|
const abstract = await abstractLessFromVue()
|
|
|
|
}
|
|
|
|
|
|
|
|
async function abstractLessFromVue () {
|
|
|
|
fileForEach(COMPILE_SRC, async src => {
|
|
|
|
if (path.extname(src) !== '.vue') return
|
|
|
|
|
|
|
|
const data = await readFile(src).split('<style>')
|
|
|
|
|
|
|
|
const style = data
|
|
|
|
|
|
|
|
console.warn(data)
|
2019-07-03 18:32:59 +08:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
start
|
|
|
|
}
|
|
|
|
|
|
|
|
|