fixed windows path

pull/1/head
yutent 2022-10-21 14:22:27 +08:00
parent 1d168f75ec
commit f0cb82e2c0
2 changed files with 5 additions and 3 deletions

View File

@ -13,15 +13,17 @@ import createServer from './lib/dev.js'
import compile from './lib/prod.js'
const WORK_SPACE = process.cwd()
const IS_WINDOWS = process.platform === 'win32'
const CONFIG_FILE = join(WORK_SPACE, 'vue.live.js')
const SOURCE_DIR = join(WORK_SPACE, 'src')
const PROTOCOL = IS_WINDOWS ? 'file://' : ''
let args = process.argv.slice(2)
switch (args[0]) {
case 'dev':
import(CONFIG_FILE)
import(PROTOCOL + CONFIG_FILE)
.then(function (conf) {
createServer(SOURCE_DIR, conf.default)
})
@ -31,7 +33,7 @@ switch (args[0]) {
break
case 'build':
import(CONFIG_FILE)
import(PROTOCOL + CONFIG_FILE)
.then(function (conf) {
let dist = conf.buildDir || 'dist'
if (fs.isdir(dist)) {

View File

@ -1,7 +1,7 @@
{
"name": "@bytedo/vue-live",
"type": "module",
"version": "0.0.10",
"version": "0.0.11",
"bin": {
"vue-live": "index.js"
},