parent
ba63cd14ba
commit
e6af6842a5
2
index.js
2
index.js
|
@ -55,7 +55,7 @@ switch (mode) {
|
||||||
.then(function (conf) {
|
.then(function (conf) {
|
||||||
let dist = conf.buildDir || 'dist'
|
let dist = conf.buildDir || 'dist'
|
||||||
if (clean && fs.isdir(dist)) {
|
if (clean && fs.isdir(dist)) {
|
||||||
fs.mkdir(dist)
|
fs.rm(dist)
|
||||||
}
|
}
|
||||||
compile(WORK_SPACE, dist, conf.default)
|
compile(WORK_SPACE, dist, conf.default)
|
||||||
})
|
})
|
||||||
|
|
18
lib/prod.js
18
lib/prod.js
|
@ -96,6 +96,7 @@ export default function compile(root = '', dist = '', conf = {}) {
|
||||||
let code = fs.cat(it.path)
|
let code = fs.cat(it.path)
|
||||||
|
|
||||||
code = parseJs(code + '', conf.imports, options)
|
code = parseJs(code + '', conf.imports, options)
|
||||||
|
|
||||||
Es.transform(code, { minify: true }).then(r => {
|
Es.transform(code, { minify: true }).then(r => {
|
||||||
fs.echo(r.code, join(dist, 'assets/', pageDir, it.name))
|
fs.echo(r.code, join(dist, 'assets/', pageDir, it.name))
|
||||||
})
|
})
|
||||||
|
@ -105,14 +106,17 @@ export default function compile(root = '', dist = '', conf = {}) {
|
||||||
case '.scss':
|
case '.scss':
|
||||||
case '.css':
|
case '.css':
|
||||||
{
|
{
|
||||||
let code = compileScss(it.path)
|
let target = join(
|
||||||
// if (!it.name.startsWith('assets')) {
|
dist,
|
||||||
// it.name = 'assets/' + it.name
|
'assets/',
|
||||||
// }
|
it.name.replace(/\.scss$/, '.css')
|
||||||
fs.echo(
|
|
||||||
code,
|
|
||||||
join(dist, 'assets/', it.name.replace(/\.scss$/, '.css'))
|
|
||||||
)
|
)
|
||||||
|
if (it.ext === '.css') {
|
||||||
|
fs.cp(it.path, target)
|
||||||
|
} else {
|
||||||
|
let code = compileScss(it.path)
|
||||||
|
fs.echo(code, target)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "fite",
|
"name": "fite",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.1.4",
|
"version": "1.1.5",
|
||||||
"bin": {
|
"bin": {
|
||||||
"fite": "index.js"
|
"fite": "index.js"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue