Skip to content

Commit

Permalink
Build source files
Browse files Browse the repository at this point in the history
Update to 3.4.2
  • Loading branch information
Joris Daniel committed Dec 23, 2019
1 parent 806bd0a commit 9bcbc14
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,10 @@
# 3.4.2

#### Updates

* Build source files


# 3.4.1

#### New features
Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,5 +1,5 @@
<p>
<img alt="TravisCI" src="https://img.shields.io/badge/chunks--webpack--plugin-v3.4.1-546e7a.svg?style=for-the-badge">
<img alt="TravisCI" src="https://img.shields.io/badge/chunks--webpack--plugin-v3.4.2-546e7a.svg?style=for-the-badge">
<a href="https://travis-ci.com/yoriiis/chunks-webpack-plugin">
<img alt="TravisCI" src="https://img.shields.io/travis/com/yoriiis/chunks-webpack-plugin/master?style=for-the-badge">
</a>
Expand Down
19 changes: 9 additions & 10 deletions dist/index.js
Expand Up @@ -3,7 +3,7 @@
/**
* @license MIT
* @name ChunksWebpackPlugin
* @version 3.4.1
* @version 3.4.2
* @author: Yoriiis aka Joris DANIEL <joris.daniel@gmail.com>
* @description: Easily create HTML files with all chunks by entrypoint (based on Webpack chunkGroups)
* {@link https://github.com/yoriiis/chunks-webpack-plugins}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 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",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
@@ -1,7 +1,7 @@
/**
* @license MIT
* @name ChunksWebpackPlugin
* @version 3.4.1
* @version 3.4.2
* @author: Yoriiis aka Joris DANIEL <joris.daniel@gmail.com>
* @description: Easily create HTML files with all chunks by entrypoint (based on Webpack chunkGroups)
* {@link https://github.com/yoriiis/chunks-webpack-plugins}
Expand Down

0 comments on commit 9bcbc14

Please sign in to comment.