Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: egoist/tsup
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.6.2
Choose a base ref
...
head repository: egoist/tsup
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.6.3
Choose a head ref
  • 3 commits
  • 3 files changed
  • 2 contributors

Commits on Feb 14, 2023

  1. Copy the full SHA
    2ad00aa View commit details
  2. Copy the full SHA
    49cde79 View commit details
  3. 1
    Copy the full SHA
    9639352 View commit details
Showing with 22 additions and 19 deletions.
  1. +2 −2 package.json
  2. +11 −16 pnpm-lock.yaml
  3. +9 −1 src/plugin.ts
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@
"postcss-simple-vars": "6.0.3",
"prettier": "2.5.1",
"resolve": "1.20.0",
"rollup-plugin-dts": "5.1.0",
"rollup-plugin-dts": "5.2.0",
"rollup-plugin-hashbang": "2.2.2",
"strip-json-comments": "4.0.0",
"svelte": "3.46.4",
@@ -88,6 +88,6 @@
}
},
"engines": {
"node": ">=14"
"node": ">=14.18"
}
}
27 changes: 11 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
@@ -16,6 +16,9 @@ export type ChunkInfo = {
* Sets the file mode
*/
mode?: number
entryPoint?: string
exports?: string[]
imports?: Metafile['outputs'][string]['imports']
}

export type AssetInfo = {
@@ -119,13 +122,18 @@ export class PluginContainer {
}) {
const files: Array<ChunkInfo | AssetInfo> = outputFiles
.filter((file) => !file.path.endsWith('.map'))
.map((file) => {
.map((file): ChunkInfo | AssetInfo => {
if (isJS(file.path) || isCSS(file.path)) {
const relativePath = path.relative(process.cwd(), file.path)
const meta = metafile?.outputs[relativePath]
return {
type: 'chunk',
path: file.path,
code: file.text,
map: outputFiles.find((f) => f.path === `${file.path}.map`)?.text,
entryPoint: meta?.entryPoint,
exports: meta?.exports,
imports: meta?.imports,
}
} else {
return { type: 'asset', path: file.path, contents: file.contents }