Skip to content

Commit 091b922

Browse files
authored
Merge pull request #39 from Schulzjo/refactor_getEntryObject_function
2 parents 5c325bd + 4bd85d0 commit 091b922

File tree

1 file changed

+7
-3
lines changed
  • webpack_boilerplate/frontend_template/{{cookiecutter.project_slug}}/webpack

1 file changed

+7
-3
lines changed

webpack_boilerplate/frontend_template/{{cookiecutter.project_slug}}/webpack/webpack.common.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ const WebpackAssetsManifest = require("webpack-assets-manifest");
66

77
const getEntryObject = () => {
88
const entries = {};
9-
glob.sync(Path.join(__dirname, "../src/application/*.js")).forEach((path) => {
10-
const name = Path.basename(path, ".js");
11-
entries[name] = path;
9+
glob.sync(Path.join(__dirname, "../src/application/*.{js}")).forEach((path) => {
10+
11+
const name = Path.basename(path);
12+
const extension = Path.extname(path);
13+
const entryName = name.replace(extension, '');
14+
15+
entries[entryName] = path;
1216
});
1317
return entries;
1418
};

0 commit comments

Comments
 (0)