Skip to content

Commit a41e9d3

Browse files
committed
fix: port from bundle-utils v12-alpha logic
1 parent 99d65f8 commit a41e9d3

File tree

13 files changed

+489
-582
lines changed

13 files changed

+489
-582
lines changed

packages/bundle-utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
"@intlify/message-compiler": "^11.1.2",
2323
"@intlify/shared": "^11.1.2",
2424
"acorn": "^8.8.2",
25+
"esbuild": "^0.25.4",
2526
"escodegen": "^2.1.0",
2627
"estree-walker": "^2.0.2",
2728
"jsonc-eslint-parser": "^2.3.0",
28-
"mlly": "^1.2.0",
2929
"source-map-js": "^1.0.1",
3030
"yaml-eslint-parser": "^1.2.2"
3131
},

packages/bundle-utils/src/codegen.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import { SourceMapGenerator, SourceMapConsumer } from 'source-map-js'
2-
import {
3-
format,
4-
escapeHtml as sanitizeHtml,
5-
isBoolean,
6-
friendlyJSONstringify
7-
} from '@intlify/shared'
81
import {
92
baseCompile,
103
detectHtmlTag,
114
LOCATION_STUB
125
} from '@intlify/message-compiler'
6+
import {
7+
format,
8+
friendlyJSONstringify,
9+
isBoolean,
10+
escapeHtml as sanitizeHtml
11+
} from '@intlify/shared'
12+
import { SourceMapConsumer, SourceMapGenerator } from 'source-map-js'
1313

14-
import type { RawSourceMap, MappedPosition, MappingItem } from 'source-map-js'
1514
import type {
1615
CompileError,
17-
ResourceNode,
18-
CompileOptions
16+
CompileOptions,
17+
ResourceNode
1918
} from '@intlify/message-compiler'
19+
import type { MappedPosition, MappingItem, RawSourceMap } from 'source-map-js'
2020

2121
/**
2222
* Compilation dev environments
@@ -25,13 +25,13 @@ import type {
2525
*/
2626
export type DevEnv = 'development' | 'production'
2727

28-
export interface Position {
28+
interface Position {
2929
line: number
3030
column: number
3131
offset?: number
3232
}
3333

34-
export interface SourceLocationable {
34+
interface SourceLocationable {
3535
start?: number
3636
loc?: {
3737
start: Position
@@ -44,8 +44,6 @@ export interface SourceLocationable {
4444
*/
4545
export interface CodeGenOptions {
4646
type?: 'plain' | 'sfc' | 'bare'
47-
legacy?: boolean
48-
bridge?: boolean
4947
exportESM?: boolean
5048
onlyLocales?: string[]
5149
source?: string
@@ -75,7 +73,7 @@ export interface CodeGenOptions {
7573
) => void
7674
}
7775

78-
export interface CodeGenContext {
76+
interface CodeGenContext {
7977
source?: string
8078
code: string
8179
indentLevel: number

0 commit comments

Comments
 (0)