Skip to content

Commit

Permalink
fix: never include pkg.dependencies in bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Jun 15, 2020
1 parent 696c162 commit fc69352
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bili.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ const config: Config = {
input: {
index: 'src/index.ts',
cli: 'src/cli.ts',
babel: 'src/babel/preset.ts'
babel: 'src/babel/preset.ts',
},
bundleNodeModules: true,
externals: [
...Object.keys(require('./package').dependencies),
'spawn-sync' // from cross-spawn which is from execa which is from term-size which is from boxen
]
'spawn-sync', // from cross-spawn which is from execa which is from term-size which is from boxen
],
}

export default config
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export class Bundler {

normalizeConfig(config: Config, userConfig: Config) {
const externals = new Set([
...Object.keys(this.pkg.data.dependencies || {}),
...(Array.isArray(userConfig.externals)
? userConfig.externals
: [userConfig.externals]),
Expand Down

1 comment on commit fc69352

@vercel
Copy link

@vercel vercel bot commented on fc69352 Jun 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.