fixed windows path
parent
1d168f75ec
commit
f0cb82e2c0
6
index.js
6
index.js
|
@ -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)) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@bytedo/vue-live",
|
||||
"type": "module",
|
||||
"version": "0.0.10",
|
||||
"version": "0.0.11",
|
||||
"bin": {
|
||||
"vue-live": "index.js"
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue