Skip to content

Commit 4a991f8

Browse files
authored
improvement: bundle source map at message-compiler (#619)
* improvement: bundle source map at message-compiler * update size workflow
1 parent ef59212 commit 4a991f8

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

.github/workflows/size.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
name: Size
22
on:
33
push:
4-
branches-ignore:
5-
- gh-pages
6-
- releases/**
4+
branches:
5+
- '**'
76
pull_request:
8-
branches-ignore:
9-
- gh-pages
10-
- releases/**
11-
types:
12-
- opened
13-
- synchronize
14-
- reopened
7+
branches:
8+
- master
159
permissions:
1610
contents: read
1711
issues: write

packages/message-compiler/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
"esm-browser",
4747
"cjs",
4848
"global"
49-
]
49+
],
50+
"enableFullBundleForEsmBrowser": true
5051
},
5152
"publishConfig": {
5253
"access": "public"

rollup.config.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ function createConfig(format, output, plugins = []) {
136136

137137
const external =
138138
isGlobalBuild || isBrowserESMBuild
139-
? ['vue'] // packageOptions.enableNonBrowserBranches
139+
? packageOptions.enableFullBundleForEsmBrowser && isBrowserESMBuild
140+
? []
141+
: ['vue'] // packageOptions.enableNonBrowserBranches
140142
: // Node / esm-bundler builds. Externalize everything.
141143
[
142144
...Object.keys(pkg.dependencies || {}),
@@ -147,9 +149,7 @@ function createConfig(format, output, plugins = []) {
147149
// packageOptions.enableNonBrowserBranches && format !== 'cjs'
148150
format !== 'cjs'
149151
? [
150-
require('@rollup/plugin-node-resolve').nodeResolve({
151-
preferBuiltins: true
152-
}),
152+
require('@rollup/plugin-node-resolve').nodeResolve(),
153153
require('@rollup/plugin-commonjs')({
154154
sourceMap: false
155155
}),
@@ -175,7 +175,8 @@ function createConfig(format, output, plugins = []) {
175175
isBundlerESMBuild,
176176
isBrowserESMBuild,
177177
// isBrowserBuild?
178-
isGlobalBuild || isBrowserESMBuild || isBundlerESMBuild, // && !packageOptions.enableNonBrowserBranches,
178+
(isGlobalBuild || isBrowserESMBuild || isBundlerESMBuild) &&
179+
!packageOptions.enableFullBundleForEsmBrowser,
179180
isGlobalBuild,
180181
isNodeBuild,
181182
isRuntimeOnlyBuild,

0 commit comments

Comments
 (0)