Skip to content

Commit

Permalink
fix: show full output filename
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed May 16, 2020
1 parent 1266947 commit 827c32c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 34 deletions.
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import jsonPlugin from '@rollup/plugin-json'
import { sizePlugin, caches } from './size-plugin'
import { resolvePlugin } from './resolve-plugin'
import { isExternal } from './utils'
import { restoreRequirePlugin } from './restore-require-plugin'

type Options = {
bundle?: boolean
Expand Down Expand Up @@ -53,7 +52,6 @@ export async function createRollupConfigs(files: string[], options: Options) {
plugins: [
hashbangPlugin(),
jsonPlugin(),
!dts && restoreRequirePlugin(),
!dts &&
esbuildPlugin({
target: options.target,
Expand Down
31 changes: 0 additions & 31 deletions src/restore-require-plugin.ts

This file was deleted.

6 changes: 5 additions & 1 deletion src/size-plugin.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { join, relative } from 'path'
import { Plugin } from 'rollup'

type Cache = Map<string, () => number>
Expand All @@ -20,7 +21,10 @@ export const sizePlugin = (): Plugin => {
for (const key of Object.keys(bundle)) {
const file = bundle[key]
if (file.type === 'chunk') {
cache.set(file.fileName, () => file.code.length)
cache.set(
relative(process.cwd(), join(options.dir || '', file.fileName)),
() => file.code.length
)
}
}
}
Expand Down

0 comments on commit 827c32c

Please sign in to comment.