diff --git a/lib/asset-manifest-generator.js b/lib/asset-manifest-generator.js index 9012106..66a02c7 100644 --- a/lib/asset-manifest-generator.js +++ b/lib/asset-manifest-generator.js @@ -1,3 +1,5 @@ +'use strict'; + var Plugin = require('broccoli-caching-writer'); var walk = require('walk-sync'); var path = require('path'); @@ -101,10 +103,17 @@ AssetManifestGenerator.prototype.build = function() { var assetType = assetName.split('.').pop(); if (supportedTypes.indexOf(assetType) !== -1) { - manifest.bundles[bundleName].assets.push({ - uri: generateURI(path.join(prepend, entry)), - type: assetType - }); + + // only add non-empty assets + let fullPath = path.join(inputPath, entry); + let contents = fs.readFileSync(fullPath, 'utf-8'); + + if (contents.trim() !== '') { + manifest.bundles[bundleName].assets.push({ + uri: generateURI(path.join(prepend, entry)), + type: assetType + }); + } } } diff --git a/node-tests/fixtures/main-test/bundles/chat/assets/empty-file.css b/node-tests/fixtures/main-test/bundles/chat/assets/empty-file.css new file mode 100644 index 0000000..e69de29