Skip to content

Commit f28602f

Browse files
committed
remove duplicate warnings from console output
1 parent 33f05b8 commit f28602f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/Kaba.ts

+12-3
Original file line numberDiff line numberDiff line change
@@ -510,17 +510,24 @@ export class Kaba
510510
],
511511
};
512512

513-
return Object.keys(entries).map((entryFile, index) =>
513+
return Object.keys(entries).map(entryFile =>
514514
{
515515
let config = Object.assign({}, configTemplate, {
516516
entry: {
517517
[entryFile]: entries[entryFile],
518518
},
519519
}) as Partial<webpack.Configuration>;
520520

521-
if (isModule && undefined !== config.module)
521+
if (!isModule && undefined !== config.module)
522522
{
523-
(config.module.rules as any).push({
523+
config.module = Object.assign({}, config.module);
524+
let rules: webpack.RuleSetRule[] = [];
525+
526+
config.module.rules.forEach(rule => {
527+
rules.push(rule);
528+
});
529+
530+
rules.push({
524531
// ESLint
525532
test: /\.m?jsx?$/,
526533
// only lint files that are in the project dir & exclude tests, vendor and node_modules
@@ -536,6 +543,8 @@ export class Kaba
536543
emitWarning: true,
537544
},
538545
});
546+
547+
config.module.rules = rules;
539548
}
540549

541550
return config;

0 commit comments

Comments
 (0)