Skip to content

Commit dec2739

Browse files
committed
fix(generator): fix bin/vite for Windows (#1)
1 parent ef5c36c commit dec2739

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ the plugin\'s generator will write some `main.html` for corresponding main.{js,t
5555
pluginsOptions: {
5656
vite: {
5757
/**
58-
* will deprecated when we can auto resolve alias from vue.config.js (WIP)
58+
* will deprecated when we can auto resolve alias from vue.config.js
5959
* @ is setted by the plugin, you can set others used in your projects, like @components
6060
* Record<string, string>
6161
* @default {}

generator/template/bin/vite

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,16 @@ const params = [
1313
].filter(Boolean)
1414

1515
console.log(`running: vite ${params.join(' ')}`)
16-
const serveService = spawn('vite', params, { cwd, stdio: 'inherit' })
16+
const serveService = spawn('vite', params, {
17+
cwd,
18+
stdio: 'inherit',
19+
/**
20+
* @see https://github.com/IndexXuan/vue-cli-plugin-vite/issues/1#issuecomment-783138508
21+
* @see https://nodejs.org/api/child_process.html#child_process_default_windows_shell
22+
* closed #1
23+
*/
24+
shell: process.platform === 'win32',
25+
})
1726

1827
serveService.on('close', code => {
1928
process.exit(code)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-cli-plugin-vite",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"description": "out-of-box vite dev for vue-cli project",
55
"main": "index.js",
66
"author": "[email protected]",

0 commit comments

Comments
 (0)