Skip to content

Commit 09789d1

Browse files
authored
Merge pull request #158 from Becklyn/add-custom-webpack-config
Add custom webpack config
2 parents 946c757 + 82fc019 commit 09789d1

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @keichinger @jesko-plitt
1+
* @tkasper @thyrannoizer

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
9.0.1
2+
=====
3+
4+
* (improvement) Add possibility to add custom webpack loader. Use `addCustomLoader` in your Kaba file.
5+
6+
17
vNext
28
=====
39

src/Kaba.ts

+17
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ export class Kaba
104104
];
105105
private postCssLoaderOptions: PostCssLoaderOptions = {};
106106

107+
private customLoader: object|null = null;
108+
107109

108110
/**
109111
*
@@ -360,6 +362,16 @@ export class Kaba
360362
}
361363

362364

365+
/**
366+
* Add custom loader to webpack config
367+
*/
368+
public addCustomLoader (loader: object): this
369+
{
370+
this.customLoader = loader;
371+
return this;
372+
}
373+
374+
363375
/**
364376
* Builds the specialized webpack config for a legacy / module build
365377
*/
@@ -597,6 +609,11 @@ export class Kaba
597609
});
598610
}
599611

612+
if (null !== this.customLoader)
613+
{
614+
configTemplate.module?.rules.push(this.customLoader);
615+
}
616+
600617
return configTemplate;
601618
}
602619
}

0 commit comments

Comments
 (0)