diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8093113..cf0a4ad 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+# 3.4.2
+
+#### Updates
+
+* Build source files
+
+
# 3.4.1
#### New features
diff --git a/README.md b/README.md
index 72e2d2b..d1b73d3 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-
+
diff --git a/dist/index.js b/dist/index.js
index eee6537..2aeae04 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -3,7 +3,7 @@
/**
* @license MIT
* @name ChunksWebpackPlugin
- * @version 3.4.1
+ * @version 3.4.2
* @author: Yoriiis aka Joris DANIEL
* @description: Easily create HTML files with all chunks by entrypoint (based on Webpack chunkGroups)
* {@link https://github.com/yoriiis/chunks-webpack-plugins}
@@ -128,10 +128,8 @@ module.exports = class ChunksWebpackPlugin {
getPublicPath(compilation) {
let publicPath = compilation.options.output.publicPath || '';
- if (publicPath) {
- if (publicPath.substr(-1) !== '/') {
- publicPath = `${publicPath}/`;
- }
+ if (publicPath && publicPath.substr(-1) !== '/') {
+ publicPath = `${publicPath}/`;
}
return publicPath;
@@ -180,13 +178,14 @@ module.exports = class ChunksWebpackPlugin {
'styles': [],
'scripts': []
};
+ let extensionKeys = {
+ css: 'styles',
+ js: 'scripts'
+ };
chunks.forEach(chunk => {
chunk.files.forEach(file => {
- if (utils.getFileExtension(file) === 'css') {
- files['styles'].push(`${publicPath}${file}`);
- } else if (utils.getFileExtension(file) === 'js') {
- files['scripts'].push(`${publicPath}${file}`);
- }
+ let extension = utils.getFileExtension(file);
+ files[extensionKeys[extension]].push(`${publicPath}${file}`);
});
});
return files;
diff --git a/package-lock.json b/package-lock.json
index bcc43d2..bb49b94 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "chunks-webpack-plugin",
- "version": "3.4.1",
+ "version": "3.4.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index 4863483..6a0185c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "chunks-webpack-plugin",
- "version": "3.4.1",
+ "version": "3.4.2",
"description": "Easily create HTML files with all chunks by entrypoint (based on Webpack chunkGroups)",
"keywords": [
"chunks",
diff --git a/src/index.js b/src/index.js
index 16e1c99..aa79708 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,7 +1,7 @@
/**
* @license MIT
* @name ChunksWebpackPlugin
- * @version 3.4.1
+ * @version 3.4.2
* @author: Yoriiis aka Joris DANIEL
* @description: Easily create HTML files with all chunks by entrypoint (based on Webpack chunkGroups)
* {@link https://github.com/yoriiis/chunks-webpack-plugins}