Skip to content

Commit 0935771

Browse files
committed
Release 2.2.0
1 parent a3d1d5f commit 0935771

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sect/webpack-sweet-entry",
3-
"version": "2.1.2",
3+
"version": "2.2.0",
44
"description": "Dynamic entry points with wildcards / Partial files named with a leading underscore / Keep Directory Structure for output",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import fg from 'fast-glob'
1+
import fg from 'fast-glob';
22

33
interface EntryPoints {
44
[key: string]: string;
@@ -8,7 +8,7 @@ const splitString = (stringToSplit: string, separator: string) => stringToSplit.
88

99
const dropUnderscoreFiles = (obj: EntryPoints) => {
1010
const r: EntryPoints = {};
11-
Object.keys(obj).forEach(function(key) {
11+
Object.keys(obj).forEach(function (key) {
1212
const val = this[key]; // this == obj
1313
if (key.substring(0, 1) !== '_' && !key.includes('/_')) {
1414
r[key] = val;
@@ -27,9 +27,7 @@ export const WebpackSweetEntry = (paths: string, ext: string | string[] = 'js',
2727
const r: EntryPoints = {};
2828
const rp = Array.isArray(ext) ? createRegex(ext) : `.${ext}`;
2929
g.forEach((path: string) => {
30-
const key = splitString(path, `/${parentdir}/`)
31-
.slice(-1)[0]
32-
.replace(rp, '');
30+
const key = splitString(path, `/${parentdir}/`).slice(-1)[0].replace(rp, '');
3331
r[key] = path;
3432
});
3533
return dropUnderscoreFiles(r);

0 commit comments

Comments
 (0)