-
Notifications
You must be signed in to change notification settings - Fork 44
refactor: Bundle browser-test-runner
#3333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
38fbf01
Bundle `browser-test-runner`
mondoreale cbb704c
Scope `reset-self` to `dist/` for speed
mondoreale 744fb9b
Incl. source maps for the remaining outputs
mondoreale a9c1fea
Pack karma-setup.js, too
mondoreale 0d757c6
For consistency, define "missing" externals
mondoreale 7d9b409
Incl. .map files
mondoreale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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,95 @@ | ||
| import { defineConfig, type RollupOptions } from 'rollup' | ||
| import { dts } from 'rollup-plugin-dts' | ||
| import { nodeResolve } from '@rollup/plugin-node-resolve' | ||
|
|
||
| export default defineConfig([ | ||
| ...nodejs(), | ||
| nodejsTypes(), | ||
| ]) | ||
|
|
||
| function nodejs(): RollupOptions[] { | ||
| return [ | ||
| { | ||
| input: './dist/src/exports.js', | ||
| output: [ | ||
| { | ||
| format: 'es', | ||
| file: './dist/exports.js', | ||
| sourcemap: true, | ||
| }, | ||
| { | ||
| format: 'cjs', | ||
| file: './dist/exports.cjs', | ||
| sourcemap: true, | ||
| }, | ||
| ], | ||
| plugins: [ | ||
| nodeResolve({ | ||
| preferBuiltins: true, | ||
| }), | ||
| ], | ||
| external: [ | ||
| /node_modules/, | ||
| /@streamr\//, | ||
| ], | ||
| }, | ||
| { | ||
| /** | ||
| * We need a CJS preload file for Electron apps - that's the only format they support. | ||
| */ | ||
| input: './dist/src/preload.js', | ||
| output: [ | ||
| { | ||
| format: 'cjs', | ||
| file: './dist/preload.cjs', | ||
|
mondoreale marked this conversation as resolved.
|
||
| sourcemap: true, | ||
| }, | ||
| ], | ||
|
mondoreale marked this conversation as resolved.
|
||
| external: [ | ||
| /node_modules/, | ||
| /@streamr\//, | ||
| ], | ||
|
mondoreale marked this conversation as resolved.
|
||
| }, | ||
| { | ||
| /** | ||
| * For Karma test runner. We only need ES module format here. | ||
| */ | ||
| input: './dist/src/karma-setup.js', | ||
| output: [ | ||
| { | ||
| format: 'es', | ||
| file: './dist/karma-setup.js', | ||
|
mondoreale marked this conversation as resolved.
|
||
| sourcemap: true, | ||
| }, | ||
| ], | ||
| plugins: [ | ||
| nodeResolve({ | ||
| preferBuiltins: true, | ||
| }), | ||
| ], | ||
| external: [ | ||
| /node_modules/, | ||
| /@streamr\//, | ||
| ], | ||
| }, | ||
| ] | ||
| } | ||
|
|
||
| function nodejsTypes(): RollupOptions { | ||
| return { | ||
| input: './dist/src/exports.d.ts', | ||
| output: [ | ||
| { | ||
| file: './dist/exports.d.ts', | ||
| }, | ||
| ], | ||
| plugins: [ | ||
| nodeResolve(), | ||
| dts(), | ||
| ], | ||
| external: [ | ||
| /node_modules/, | ||
| /@streamr\//, | ||
| ], | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.