Skip to content

Commit

Permalink
build: fix vite alias resolving for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
j4k0xb committed Nov 17, 2024
1 parent f49c737 commit bbbee26
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions apps/playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import path from 'node:path';
import { defineConfig } from 'vite';
import monacoEditor from 'vite-plugin-monaco-editor';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import solid from 'vite-plugin-solid';

const __dirname = new URL('.', import.meta.url).pathname;

// https://github.com/vdesjs/vite-plugin-monaco-editor/issues/21
const { default: monacoEditorPlugin } = monacoEditor as unknown as {
default: typeof monacoEditor;
Expand Down Expand Up @@ -34,9 +33,12 @@ export default defineConfig({
alias: {
// @codemod/matchers imports @codemod/utils which imports @babel/core, but it's not needed
// by replacing it with a dummy module we can reduce the bundle size by 360kb
'@babel/core': __dirname + '/src/_empty.ts',
'isolated-vm': __dirname + '/src/_empty.ts',
webcrack: __dirname + '../../packages/webcrack/src',
'@babel/core': path.resolve(import.meta.dirname, 'src/_empty.ts'),
'isolated-vm': path.resolve(import.meta.dirname, 'src/_empty.ts'),
webcrack: path.resolve(
import.meta.dirname,
'../../packages/webcrack/src',
),
},
},
plugins: [
Expand Down

0 comments on commit bbbee26

Please sign in to comment.