-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AG-36016 Improve builds for CSS Tokenizer and AGTree
Merge in ADGUARD-FILTERS/tsurlfilter from fix/AG-36016 to master Squashed commit of the following: commit b063007 Merge: bc00457 f13c5a0 Author: scripthunter7 <[email protected]> Date: Wed Sep 18 15:24:39 2024 +0200 Merge branch 'master' into fix/AG-36016 commit bc00457 Author: scripthunter7 <[email protected]> Date: Wed Sep 18 10:47:00 2024 +0200 bump date commit 5dae2da Author: scripthunter7 <[email protected]> Date: Wed Sep 18 10:22:11 2024 +0200 change dts to types commit eab9f6e Author: scripthunter7 <[email protected]> Date: Tue Sep 17 17:31:49 2024 +0200 throw error instead commit 87a6431 Author: scripthunter7 <[email protected]> Date: Tue Sep 17 17:11:54 2024 +0200 refactor plugin extractor commit 8d9b495 Author: scripthunter7 <[email protected]> Date: Tue Sep 17 16:50:52 2024 +0200 optimize build for agtree commit c00a8fb Author: scripthunter7 <[email protected]> Date: Tue Sep 17 16:50:05 2024 +0200 optimize build for css tokenizer
- Loading branch information
1 parent
f13c5a0
commit 0a3e95b
Showing
10 changed files
with
212 additions
and
1,318 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
28 changes: 28 additions & 0 deletions
28
packages/agtree/browser-benchmark/helpers/extract-rollup-plugins.ts
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,28 @@ | ||
import { type Plugin } from 'rollup'; | ||
|
||
/** | ||
* Extract Rollup plugins from a list of plugins by their names. | ||
* It extracts the plugins in the order they appear in the list. | ||
* | ||
* @param plugins The list of plugins. | ||
* @param names The names of the plugins to extract. | ||
* | ||
* @returns The extracted plugins. | ||
* | ||
* @throws If a plugin with the given name is not found. | ||
*/ | ||
export const extractRollupPlugins = (plugins: Plugin[], names: string[]): Plugin[] => { | ||
const extractedPlugins: Plugin[] = []; | ||
|
||
for (const name of names) { | ||
const plugin = plugins.find((p) => p.name === name); | ||
|
||
if (!plugin) { | ||
throw new Error(`Plugin "${name}" not found`); | ||
} | ||
|
||
extractedPlugins.push(plugin); | ||
} | ||
|
||
return extractedPlugins; | ||
}; |
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
Oops, something went wrong.