File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
packages-integrations/vscode Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 11import type { FilterPattern } from 'unplugin-utils'
22import type { ExtensionContext , StatusBarItem } from 'vscode'
33import path , { dirname } from 'path'
4- import process from 'process'
54import { defaultPipelineExclude , defaultPipelineInclude } from '#integration/defaults'
65import { toArray } from '@unocss/core'
76import { findUp } from 'find-up'
@@ -19,10 +18,6 @@ const skipMap = {
1918}
2019
2120export async function activate ( ext : ExtensionContext ) {
22- // Neither Jiti2 nor Tsx supports running in VS Code yet
23- // We have to use Jiti1 for now
24- process . env . IMPORTX_LOADER = 'jiti-v1'
25-
2621 log . appendLine ( `⚪️ UnoCSS for VS Code v${ version } \n` )
2722
2823 const projectPath = workspace . workspaceFolders ?. [ 0 ] . uri . fsPath
Original file line number Diff line number Diff line change 1+ import { copyFile } from 'node:fs/promises'
2+ import { dirname , join } from 'node:path'
3+ import { fileURLToPath } from 'node:url'
14import { defineConfig } from 'tsup'
25
36export default defineConfig ( {
@@ -19,4 +22,16 @@ export default defineConfig({
1922 '.CMD' : 'file' ,
2023 '.md' : 'file' ,
2124 } ,
25+ clean : true ,
26+ onSuccess : async ( ) => {
27+ // Copy jiti's babel.cjs to dist/babel.cjs as workaround for https://github.com/unocss/unocss/issues/4944
28+ // jiti has hardcoded: require('../dist/babel.cjs') which esbuild cannot resolve correctly
29+ // From dist/*.cjs -> ../dist/babel.cjs resolves to dist/babel.cjs
30+ const jitiPath = dirname ( fileURLToPath ( import . meta. resolve ( 'jiti/package.json' ) ) )
31+ const babelSource = join ( jitiPath , 'dist' , 'babel.cjs' )
32+ const babelDest = join ( import . meta. dirname , 'dist' , 'babel.cjs' )
33+
34+ await copyFile ( babelSource , babelDest )
35+ console . log ( '✓ Copied babel.cjs to dist/' )
36+ } ,
2237} )
You can’t perform that action at this time.
0 commit comments