Switch assets manifest plugin

This commit is contained in:
QWp6t
2016-11-06 20:32:47 -08:00
parent c49793cd3d
commit c1bb2b3a27
4 changed files with 98 additions and 123 deletions

View File

@@ -1,19 +0,0 @@
const path = require('path');
/**
* Process AssetsPlugin output and format it
* for Sage: {"[name].[ext]":"[name]_[hash].[ext]"}
* @param {Object} assets passed by processOutput
* @return {String} JSON
*/
module.exports = (assets) => {
const manifest = {};
Object.keys(assets).forEach((name) => {
Object.keys(assets[name]).forEach((ext) => {
const filename = `${path.dirname(assets[name][ext])}/${path.basename(`${name}.${ext}`)}`;
manifest[filename] = assets[name][ext];
});
});
return manifest;
};