Skip to content

Commit 6fdea68

Browse files
committed
build: suppress rollup external warnings
1 parent 9d5e30d commit 6fdea68

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

rollup.config.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,24 @@ function createConfig(format, output, plugins = []) {
145145
}
146146

147147
let external = []
148+
const treeShakenDeps = ['source-map', '@babel/parser', 'estree-walker']
148149

149150
if (isGlobalBuild || isBrowserESMBuild || isCompatPackage) {
150151
if (!packageOptions.enableNonBrowserBranches) {
151152
// normal browser builds - non-browser only imports are tree-shaken,
152153
// they are only listed here to suppress warnings.
153-
external = ['source-map', '@babel/parser', 'estree-walker']
154+
external = treeShakenDeps
154155
}
155156
} else {
156157
// Node / esm-bundler builds.
157158
// externalize all direct deps unless it's the compat build.
158159
external = [
159160
...Object.keys(pkg.dependencies || {}),
160161
...Object.keys(pkg.peerDependencies || {}),
161-
...['path', 'url', 'stream'] // for @vue/compiler-sfc / server-renderer
162+
// for @vue/compiler-sfc / server-renderer
163+
...['path', 'url', 'stream'],
164+
// somehow these throw warnings for runtime-* package builds
165+
...treeShakenDeps
162166
]
163167
}
164168

0 commit comments

Comments
 (0)