Skip to content

Commit b471838

Browse files
committed
fix: bundle volarConfig deps
fixes #131 Volar (Vue) integration doesn't work
1 parent 3c40998 commit b471838

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

buildTsPlugin.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
import buildTsPlugin from '@zardoy/vscode-utils/build/buildTypescriptPlugin.js'
33
import { build, analyzeMetafile } from 'esbuild'
44

5-
build({
6-
// bundle: true,
5+
await build({
6+
bundle: true,
7+
external: ['typescript-essential-plugins'],
78
// minify: !watch,
89
entryPoints: ['./typescript/src/volarConfig.ts'],
910
outfile: './out/volarConfig.js',

typescript/src/volarConfig.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/* eslint-disable @typescript-eslint/no-require-imports */
22

3-
import { compact } from '@zardoy/utils'
4-
import { get } from 'lodash'
3+
import get from 'lodash/get'
54
import type { Configuration } from './types'
65

76
// will be required from ./node_modules/typescript-essential-plugins/index.js
87
const originalPluginFactory = require('typescript-essential-plugins')
98

9+
const compact = <T>(arr: (T | undefined)[]): T[] => arr.filter(Boolean) as T[]
10+
1011
const plugin = ((context, { typescript: tsModule } = {}) => {
1112
if (!context) throw new Error('Not recieve context')
1213
const { typescript } = context

0 commit comments

Comments
 (0)