Skip to content

Commit 68cb390

Browse files
committed
Remove chalk as a dependency
1 parent a3bd552 commit 68cb390

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@
4747
"test-console": "^1.0.0",
4848
"webpack": "^3.5.5"
4949
},
50-
"dependencies": {
51-
"chalk": "^2.1.0"
52-
},
50+
"dependencies": {},
5351
"nyc": {
5452
"include": [
5553
"src/**.js"

src/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* @description : This plugin will omit bundled JS files, for dependencies that are exclusively CSS which become obsolete once extract-text-plugin extracts inlined CSS into its own .css file
44
*/
55

6-
const chalk = require('chalk');
7-
86
/**
97
* @param {Object} options - Configurable options
108
* @constructor
@@ -31,9 +29,9 @@ function OmitJSforCSSPlugin(options) {
3129
*/
3230
OmitJSforCSSPlugin.prototype.omitFiles = function(omitted, compilation) {
3331
if (this.options.preview) {
34-
console.log(chalk.bold(chalk.red('PREVIEW')) + chalk.grey(' File to be omitted for ') + chalk.bold(chalk.green(omitted.chunkName)) + ' : ' + chalk.bold(chalk.green(omitted.filename)));
32+
console.log(`PREVIEW File to be omitted for ${omitted.chunkName} : ${omitted.filename}`);
3533
} else {
36-
this.options.verbose && console.log(chalk.grey('File Omitted for ') + chalk.bold(chalk.green(omitted.chunkName)) + chalk.grey(' : ') + chalk.bold(chalk.green(omitted.filename)));
34+
this.options.verbose && console.log(`File omitted for ${omitted.chunkName} : ${omitted.filename}`);
3735
delete compilation.assets[omitted.filename];
3836
}
3937
};

test/options.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ describe('Options', () => {
5858
inspect.restore();
5959

6060
assert.deepEqual(inspect.output, [
61-
'\u001b[1m\u001b[31mPREVIEW\u001b[39m\u001b[22m\u001b[90m File to be omitted for \u001b[39m\u001b[1m\u001b[32mb\u001b[39m\u001b[22m : \u001b[1m\u001b[32mb.js\u001b[39m\u001b[22m\n',
62-
'\u001b[1m\u001b[31mPREVIEW\u001b[39m\u001b[22m\u001b[90m File to be omitted for \u001b[39m\u001b[1m\u001b[32mb\u001b[39m\u001b[22m : \u001b[1m\u001b[32mb.js.map\u001b[39m\u001b[22m\n'
61+
'PREVIEW File to be omitted for b : b.js\n',
62+
'PREVIEW File to be omitted for b : b.js.map\n'
6363
]);
6464

6565
done();
@@ -91,8 +91,8 @@ describe('Options', () => {
9191
inspect.restore();
9292

9393
assert.deepEqual(inspect.output, [
94-
'\u001b[90mFile Omitted for \u001b[39m\u001b[1m\u001b[32mb\u001b[39m\u001b[22m\u001b[90m : \u001b[39m\u001b[1m\u001b[32mb.js\u001b[39m\u001b[22m\n',
95-
'\u001b[90mFile Omitted for \u001b[39m\u001b[1m\u001b[32mb\u001b[39m\u001b[22m\u001b[90m : \u001b[39m\u001b[1m\u001b[32mb.js.map\u001b[39m\u001b[22m\n'
94+
'File omitted for b : b.js\n',
95+
'File omitted for b : b.js.map\n'
9696
]);
9797

9898
done();

0 commit comments

Comments
 (0)