Skip to content

feat(build): Add args and templates to rollup debugger plugin #5085

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
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions rollup/plugins/npmPlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,44 @@ export function makeConstToVarPlugin() {
/**
* Create a plugin which can be used to pause the build process at the given hook.
*
* Hooks can be found here: https://rollupjs.org/guide/en/#build-hooks
* Hooks can be found here: https://rollupjs.org/guide/en/#build-hooks.
*
* @param hookName The name of the hook at which to pause.
* @returns A plugin which inserts a debugger statement in the phase represented by the given hook
*
* For convenience, here are pre-built debuggers for every hook:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What? I'm lazy. Typing is hard. 😛

*
* makeDebuggerPlugin('buildStart'),
* makeDebuggerPlugin('options'),
* makeDebuggerPlugin('resolveId'),
* makeDebuggerPlugin('resolveDynamicImport'),
* makeDebuggerPlugin('load'),
* makeDebuggerPlugin('transform'),
* makeDebuggerPlugin('shouldTransformCachedModule'),
* makeDebuggerPlugin('moduleParsed'),
* makeDebuggerPlugin('buildEnd'),
* makeDebuggerPlugin('watchChange'),
* makeDebuggerPlugin('closeWatcher'),
* makeDebuggerPlugin('outputOptions'),
* makeDebuggerPlugin('renderStart'),
* makeDebuggerPlugin('banner'),
* makeDebuggerPlugin('footer'),
* makeDebuggerPlugin('intro'),
* makeDebuggerPlugin('outro'),
* makeDebuggerPlugin('augmentChunkHash'),
* makeDebuggerPlugin('renderDynamicImport'),
* makeDebuggerPlugin('resolveFileUrl'),
* makeDebuggerPlugin('resolveImportMeta'),
* makeDebuggerPlugin('renderChunk'),
* makeDebuggerPlugin('renderError'),
* makeDebuggerPlugin('generateBundle'),
* makeDebuggerPlugin('writeBundle'),
* makeDebuggerPlugin('closeBundle'),
*/
export function makeDebuggerPlugin(hookName) {
return {
name: 'debugger-plugin',
[hookName]: () => {
[hookName]: (..._args) => {
// eslint-disable-next-line no-debugger
debugger;
return null;
Expand Down