mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2025-07-04 19:13:26 +08:00
fix(jsx-explorer): support browser env
This commit is contained in:
@ -1,22 +1,27 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
||||
import VueJSX from '@vitejs/plugin-vue-jsx';
|
||||
import MonacoEditorPlugin from 'vite-plugin-monaco-editor';
|
||||
import Replace from 'unplugin-replace/vite';
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
minify: 'terser',
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@vue/babel-plugin-jsx': '@vue/babel-plugin-jsx/src/index.ts',
|
||||
path: 'pathe',
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
VueJSX(),
|
||||
// @ts-expect-error
|
||||
(MonacoEditorPlugin.default as typeof MonacoEditorPlugin)({
|
||||
languageWorkers: ['editorWorkerService', 'typescript'],
|
||||
}),
|
||||
nodePolyfills({
|
||||
globals: { process: true },
|
||||
Replace({
|
||||
values: {
|
||||
'process.env.BABEL_TYPES_8_BREAKING': 'false',
|
||||
'process.env.BABEL_ENV': '"development"',
|
||||
'process.env.NODE_NDEBUG': 'true',
|
||||
'process.env.NODE_DEBUG': 'false',
|
||||
'Buffer.isBuffer': 'function isBuffer() { return false; }',
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
Reference in New Issue
Block a user