File tree Expand file tree Collapse file tree 5 files changed +20
-260
lines changed Expand file tree Collapse file tree 5 files changed +20
-260
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ export default tseslint.config(
100100 'less' ,
101101 'sass' ,
102102 'sass-embedded' ,
103+ 'terser' ,
103104 'lightningcss' ,
104105 'vitest' ,
105106 'unbuild' ,
Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ export type { Connect } from 'dep-types/connect'
252252export type { WebSocket , WebSocketAlias } from 'dep-types/ws'
253253export type { HttpProxy } from 'dep-types/http-proxy'
254254export type { FSWatcher , WatchOptions } from 'dep-types/chokidar'
255- export type { Terser } from 'dep- types/terser '
255+ export type { Terser } from 'types/internal/terserOptions '
256256export type { RollupCommonJSOptions } from 'dep-types/commonjs'
257257export type { RollupDynamicImportVarsOptions } from 'dep-types/dynamicImportVars'
258258export type { Matcher , AnymatchPattern , AnymatchFn } from 'dep-types/anymatch'
Original file line number Diff line number Diff line change 1- import type { Terser } from 'dep-types/terser'
1+ import type {
2+ TerserMinifyOptions ,
3+ TerserMinifyOutput ,
4+ } from 'types/internal/terserOptions'
25import { WorkerWithFallback } from 'artichokie'
36import type { Plugin } from '../plugin'
47import type { ResolvedConfig } from '..'
58import { requireResolveFromRootWithFallback } from '../utils'
69
7- export interface TerserOptions extends Terser . MinifyOptions {
10+ export interface TerserOptions extends TerserMinifyOptions {
811 /**
912 * Vite-specific option to specify the max number of workers to spawn
1013 * when minifying files with terser.
@@ -42,12 +45,12 @@ export function terserPlugin(config: ResolvedConfig): Plugin {
4245 async (
4346 terserPath : string ,
4447 code : string ,
45- options : Terser . MinifyOptions ,
48+ options : TerserMinifyOptions ,
4649 ) => {
4750 // test fails when using `import`. maybe related: https://github.com/nodejs/node/issues/43205
4851 // eslint-disable-next-line no-restricted-globals -- this function runs inside cjs
4952 const terser = require ( terserPath )
50- return terser . minify ( code , options ) as Terser . MinifyOutput
53+ return terser . minify ( code , options ) as TerserMinifyOutput
5154 } ,
5255 {
5356 shouldUseFake ( _terserPath , _code , options ) {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ /* eslint-disable @typescript-eslint/ban-ts-comment */
2+
3+ // @ts -ignore `terser` may not be installed
4+ export type * as Terser from 'terser'
5+ // @ts -ignore `terser` may not be installed
6+ import type * as Terser from 'terser'
7+
8+ /* eslint-enable @typescript-eslint/ban-ts-comment */
9+
10+ export type TerserMinifyOptions = Terser . MinifyOptions
11+ export type TerserMinifyOutput = Terser . MinifyOutput
You can’t perform that action at this time.
0 commit comments