Skip to content

Commit c3fa547

Browse files
committed
add debugger plugin
1 parent b17acb2 commit c3fa547

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

rollup/plugins/npmPlugins.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,22 @@ export function makeConstToVarPlugin() {
4242
},
4343
});
4444
}
45+
46+
/**
47+
* Create a plugin which can be used to pause the build process at the given hook.
48+
*
49+
* Hooks can be found here: https://rollupjs.org/guide/en/#build-hooks
50+
*
51+
* @param hookName The name of the hook at which to pause.
52+
* @returns A plugin which inserts a debugger statement in the phase represented by the given hook
53+
*/
54+
export function makeDebuggerPlugin(hookName) {
55+
return {
56+
name: 'debugger-plugin',
57+
[hookName]: () => {
58+
// eslint-disable-next-line no-debugger
59+
debugger;
60+
return null;
61+
},
62+
};
63+
}

0 commit comments

Comments
 (0)