Skip to content
This repository was archived by the owner on Oct 30, 2020. It is now read-only.

Commit 5fc62ba

Browse files
committed
add some colour to output
1 parent 9057c3b commit 5fc62ba

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"css modules webpack typings"
3131
],
3232
"dependencies": {
33+
"colour": "0.7.1",
3334
"css-loader": ">=0.23.1",
3435
"graceful-fs": "4.1.4",
3536
"loader-utils": "0.2.16"

src/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import cssLoader from 'css-loader';
22
import cssLocalsLoader from 'css-loader/locals';
33
import loaderUtils from 'loader-utils';
4+
import 'colour';
5+
46
import {
57
filterNonWordClasses,
68
generateNamedExports,
@@ -23,7 +25,7 @@ module.exports = function(input) {
2325
const query = loaderUtils.parseQuery(this.query);
2426
const moduleMode = query.modules || query.module;
2527
if (!moduleMode) {
26-
console.warn('Typings for CSS-Modules: option `modules` is not active - skipping extraction work...');
28+
console.warn('Typings for CSS-Modules: option `modules` is not active - skipping extraction work...').red;
2729
return delegateToCssLoader(ctx, input, callback);
2830
}
2931

@@ -42,8 +44,8 @@ module.exports = function(input) {
4244
if (skippedDefinitions.length > 0 && !query.camelCase) {
4345
console.warn(`Typings for CSS-Modules: option 'namedExport' was set but 'camelCase' for the css-loader not.
4446
The following classes will not be available as named exports:
45-
${skippedDefinitions.map(sd => ` - "${sd}"`).join('\n')}
46-
`)
47+
${skippedDefinitions.map(sd => ` - "${sd}"`).join('\n').red}
48+
`.yellow);
4749
}
4850
cssModuleDefinition = generateNamedExports(cleanedDefinitions);
4951
}

0 commit comments

Comments
 (0)