-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(TypedMessenger): Make sure TypedMessenger still works in minified…
… builds (#933)
- Loading branch information
1 parent
8abbbb1
commit 25960e2
Showing
14 changed files
with
645 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ npm_packages | |
deno.lock | ||
npmPackage | ||
jsrPackage | ||
test/minified/out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { minify } from "terser"; | ||
|
||
const nameCache = {}; | ||
|
||
/** | ||
* A rollup plugin for minifying builds. | ||
* @param {import("terser").MinifyOptions} minifyOptions | ||
* @returns {import("rollup").Plugin} | ||
*/ | ||
export function rollupTerserPlugin(minifyOptions = {}) { | ||
return { | ||
name: "terser", | ||
async renderChunk(code, chunk, outputOptions) { | ||
const output = await minify(code, { | ||
...minifyOptions, | ||
nameCache, | ||
}); | ||
if (!output.code) return null; | ||
return { | ||
code: output.code, | ||
map: output.map, | ||
}; | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// This re-exports all engine files. | ||
// When building the tests, this file will export from 'dist/renda.min.js' instead. | ||
// This allows us to run the tests without building as well, and makes it easer | ||
// to check types when the tests haven't been built yet. | ||
|
||
export * from "../../../src/mod.js"; |
Oops, something went wrong.