This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
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.
- create folder for internal loaders and plugins - fix the length of the lines - update readme files
- Loading branch information
1 parent
6e656f5
commit a4978da
Showing
5 changed files
with
41 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Class representing a webpack plugin for clearing the terminal screen. | ||
* | ||
* @requires webpack version >=4 | ||
* @version 1.0.0 | ||
* @author janeRivas <[email protected]> | ||
* @license MIT | ||
*/ | ||
class TerminalClearPlugin { | ||
/** | ||
* @param {Boolean} [saveHistory=true] - indicates whether to keep the terminal history or not | ||
*/ | ||
constructor({ saveHistory = true } = { }) { | ||
this.saveHistory = saveHistory | ||
} | ||
|
||
/** | ||
* Installs the plugin. | ||
* https://webpack.js.org/contribute/writing-a-plugin/#basic-plugin-architecture | ||
*/ | ||
apply(compiler) { | ||
compiler.hooks.beforeCompile.tapAsync('TerminalClearPlugin', (params, callback) => { | ||
process.stdout.write(this.saveHistory ? '\x1B[H\x1B[2J' : '\x1B[2J\x1B[3J\x1B[H\x1Bc') | ||
callback() | ||
}) | ||
} | ||
} | ||
|
||
|
||
module.exports = TerminalClearPlugin |
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 |
---|---|---|
@@ -1,30 +1,8 @@ | ||
/** | ||
* Class representing a webpack plugin for clearing the terminal screen. | ||
* | ||
* @requires webpack version >=4 | ||
* @version 1.0.0 | ||
* @author janeRivas <[email protected]> | ||
* @license MIT | ||
*/ | ||
class TerminalClearPlugin { | ||
/** | ||
* @param {Boolean} [saveHistory=true] - indicates whether to keep the terminal history or not | ||
*/ | ||
constructor({ saveHistory = true } = { }) { | ||
this.saveHistory = saveHistory | ||
} | ||
|
||
/** | ||
* Installs the plugin. | ||
* https://webpack.js.org/contribute/writing-a-plugin/#basic-plugin-architecture | ||
*/ | ||
apply(compiler) { | ||
compiler.hooks.beforeCompile.tapAsync('TerminalClearPlugin', (params, callback) => { | ||
process.stdout.write(this.saveHistory ? '\x1B[H\x1B[2J' : '\x1B[2J\x1B[3J\x1B[H\x1Bc') | ||
callback() | ||
}) | ||
} | ||
} | ||
const TerminalClearPlugin = require('../modules/terminal-clear-plugin') | ||
|
||
|
||
module.exports = new TerminalClearPlugin() | ||
/** | ||
* Clears the terminal screen. | ||
* ../modules/clear-termina-plugin | ||
*/ | ||
module.exports = new TerminalClearPlugin({ }) |
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