chore: Consolidate infrastructure of webpack to ts to make it scriptable

Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Iku-tursoandJanne Savolainen committed 2023-05-03 09:31:24 +03:00
1 parent f2f6cc500c
commit 9a4b02becb
24 files changed
+230 -190

No files matched your search

@@ -1,3 +0,0 @@
const toModuleMatcherRegExp = x => new RegExp(`^${x}(/.*)*$`);
module.exports = { toModuleMatcherRegExp };
@@ -1,7 +1,7 @@
import { toModuleMatcherRegExp } from "./to-module-matcher-reg-exp";
describe('to-module-matcher-reg-exp', () => {
let regExp;
let regExp: RegExp;
beforeEach(() => {
regExp = toModuleMatcherRegExp("some-package");
@@ -10,7 +10,7 @@ describe('to-module-matcher-reg-exp', () => {
it('given exactly matching package, matches', () => {
const targetString = 'some-package';
const [match] = targetString.match(regExp);
const [match] = targetString.match(regExp)!;
expect(match).toBeTruthy()
});
@@ -18,7 +18,7 @@ describe('to-module-matcher-reg-exp', () => {
it('given matching package with entrypoint, matches', () => {
const targetString = 'some-package/some-entrypoint';
const [match] = targetString.match(regExp);
const [match] = targetString.match(regExp)!;
expect(match).toBeTruthy()
});
@@ -26,7 +26,7 @@ describe('to-module-matcher-reg-exp', () => {
it('given matching package with directory, matches', () => {
const targetString = 'some-package/some-directory/some-other-directory';
const [match] = targetString.match(regExp);
const [match] = targetString.match(regExp)!;
expect(match).toBeTruthy()
});
@@ -0,0 +1 @@
export const toModuleMatcherRegExp = (x: string) => new RegExp(`^${x}(/.*)*$`);