Skip to content

Commit

Permalink
fix: can't recognize viteBinPath on Windows (#1074)
Browse files Browse the repository at this point in the history
* fix: can't recognize viteBinPath on Windows

* fix: previewer not working with pnpm

Co-authored-by: johnsoncodehk <johnsoncodehk@gmail.com>
  • Loading branch information
Dragon-GCS and johnsoncodehk committed Mar 20, 2022
1 parent c65872f commit d3014ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extensions/vscode-vue-language-features/bin/vite.js
Expand Up @@ -5,7 +5,7 @@ const fs = require('fs');
const readFileSync = fs.readFileSync;

const workspace = process.cwd();
const viteBinPath = require.resolve('./node_modules/.bin/vite', { paths: [workspace] });
const viteBinPath = require.resolve('vite/bin/vite.js', { paths: [workspace] });
const viteDir = path.dirname(require.resolve('vite/package.json', { paths: [workspace] }));
const vuePluginPath = require.resolve('@vitejs/plugin-vue', { paths: [workspace] });
const installCode = `
Expand Down Expand Up @@ -155,7 +155,7 @@ function __installPreview(app) {
}
}
`;
const replaceCode =`async function doTransform(...args) {
const replaceCode = `async function doTransform(...args) {
const result = await __doTransformOriginal(...args);
const createAppText = 'createApp,';
if (args[0].indexOf('vue.js?') >= 0 && result.code && result.code.indexOf(createAppText) >= 0 && result.code.indexOf('__createAppProxy') === -1) {
Expand Down

0 comments on commit d3014ed

Please sign in to comment.