diff --git a/index.js b/index.js index 5e1df59..e804499 100755 --- a/index.js +++ b/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)) { diff --git a/package.json b/package.json index 1c10be5..a9f095b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@bytedo/vue-live", "type": "module", - "version": "0.0.10", + "version": "0.0.11", "bin": { "vue-live": "index.js" },