@cara/porter
Advanced tools
Comparing version 4.3.2 to 4.3.3
{ | ||
"name": "@cara/porter", | ||
"description": "A middleware for web modules", | ||
"version": "4.3.2", | ||
"version": "4.3.3", | ||
"main": "src/porter.js", | ||
@@ -46,3 +46,3 @@ "repository": { | ||
"license": "BSD-3-Clause", | ||
"gitHead": "d7f14b66ad97ac81f734cf737cf67cd2ec55fefe" | ||
"gitHead": "2495caf36b6b169ca1320b0259e211d49225287f" | ||
} |
@@ -33,3 +33,3 @@ 'use strict'; | ||
const bundle = Bundle.create(options); | ||
const results = [ bundle ]; | ||
const results = [bundle]; | ||
const entry = packet.files[entries[0]]; | ||
@@ -40,3 +40,3 @@ | ||
for (const mod of Object.values(packet.entries)) { | ||
if (mod.file !== entry.file && mod.file.replace(rExt, '.css') === entry.file) { | ||
if (!entries.includes(mod.file) && mod.file.replace(rExt, '.css') === entry.file) { | ||
entries.push(mod.file); | ||
@@ -46,4 +46,10 @@ break; | ||
} | ||
// if there are multiple entries, the returned bundle might not contain all of them | ||
for (const file of entries) { | ||
if (!bundle.entries.includes(file)) bundle.entries.push(file); | ||
if (bundle.entries.includes(file)) continue; | ||
if (path.extname(file) === '.css') { | ||
bundle.entries.push(file); | ||
} else { | ||
bundle.entries.unshift(file); | ||
} | ||
} | ||
@@ -50,0 +56,0 @@ return results; |
138956
3541