Skip to content

Commit

Permalink
fix: vite plugin import path incorrect on windows
Browse files Browse the repository at this point in the history
close #1772
  • Loading branch information
johnsoncodehk committed Aug 26, 2022
1 parent f9a14dd commit dd9b361
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Expand Up @@ -26,7 +26,7 @@ export async function register(context: vscode.ExtensionContext) {
let avoidUpdateOnDidChangeActiveTextEditor = false;
let updateComponentPreview: Function | undefined;

const statusBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right);
const statusBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, -1);
statusBar.command = 'volar.previewMenu';
statusBar.backgroundColor = new vscode.ThemeColor('statusBarItem.warningBackground');
context.subscriptions.push(statusBar);
Expand Down
2 changes: 1 addition & 1 deletion packages/preview/bin/vite.js
Expand Up @@ -84,7 +84,7 @@ else {

function createViteConfig() {
let proxyConfigContent = readFileSync(path.resolve(__dirname, 'vite', 'config.ts'), { encoding: 'utf8' });
proxyConfigContent = proxyConfigContent.replace('{CONFIG_PATH}', path.resolve(workspace, 'vite.config'));
proxyConfigContent = proxyConfigContent.replace('{CONFIG_PATH}', JSON.stringify(path.resolve(workspace, 'vite.config')));

const proxyConfigPath = path.resolve(workspace, 'node_modules', '.vite', 'volar-vite.config.ts');
fs.writeFileSync(proxyConfigPath, proxyConfigContent);
Expand Down
2 changes: 1 addition & 1 deletion packages/preview/bin/vite/config.ts
@@ -1,5 +1,5 @@
// @ts-nocheck
import config from '{CONFIG_PATH}';
import config from {CONFIG_PATH};

if (!config.plugins)
config.plugins = [];
Expand Down

0 comments on commit dd9b361

Please sign in to comment.