Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ StaticSiteGeneratorWebpackPlugin.prototype.apply = function(compiler) {
renderPromises = self.outputPaths.map(function(outputPath) {
var outputFileName = outputPath.replace(/^(\/|\\)/, ''); // Remove leading slashes for webpack-dev-server

if (!/\.(html?)$/i.test(outputFileName)) {
// If there is no extension, then assume it's a folder and add an index.html file
// (for a path like `/directory.with.dots/` then use `/directory.with.dots/index.html` )
if (!/\.(\w+)$/i.test(outputFileName)) {
outputFileName = path.join(outputFileName, 'index.html');
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<html>
<body>
<h1>/foo.bar/index.html</h1>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<html>
<body>
<h1>/foo/bar/custom_ext.liquid</h1>
</body>
</html>
4 changes: 3 additions & 1 deletion test/success-cases/custom-file-names/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ var template = ejs.compile(fs.readFileSync(__dirname + '/template.ejs', 'utf-8')
var paths = [
'/custom.html',
'/foo/custom.html',
'/foo/bar/custom.html'
'/foo/bar/custom.html',
'/foo/bar/custom_ext.liquid',
'/foo.bar/index.html',
];

module.exports = {
Expand Down