content-manifest-webpack-plugin
v1.0.4
Published
Generates a manifest of all the files in the specified directory.
Downloads
4
Readme
content-manifest-webpack-plugin
Generates a manifest of all the files in the specified directory.
Install
npm install content-manifest-webpack-plugin --save-dev
Usage
let contentManifest = require('content-manifest-webpack-plugin');
module.exports = {
...,
plugins: [
/**
* {string} path content path
* {string} output manifest output path
* {string} key key ([name] [base] [ext])
* {string} value value ([name] [base] [ext])
*/
new contentManifest({
'path': path.resolve(__dirname, './assest'),
'output': path.resolve(__dirname, './assets-manifest.json'),
'key': '[base] = [name] + [ext]',
'value': '/assets/[base] = [name] + [ext]'
})
]
}
- [name] filename without extension name
- [base] filename with extension name
- [ext] extension name
eg
$ ls assest
05cff9c847adbe7d502debc85facbb82.png f27101b6d1780b3d7be4ef2e4252567f.png
07a6cd0d34a0588ff268b93c257cb5c5.png favicon.ico
331fda2135e5a8eea2daa000a75ce402.png flvVideo.js
3bdb8d486ef00a56902e522f4a470bec.png hlsVideo.js
47918a8a98d27e7a6d0d7553d4cafc53.png icon.svg
55a5c30d282234b6db2fbf8dda81a1e9.png image-placeholder.svg
66954465ea2a1a0b87ffe39d4a01a19f.png nativehlsVideo.js
7bf95d737c9c9e204456178f0cffe103.png player.js
dbb155635a448338eb46ae145ca05ce4.png [email protected]
f18c25483b294bd311fd50dcf39dde24.png
$ cat assets-manifest.json
{
"05cff9c847adbe7d502debc85facbb82.png = 05cff9c847adbe7d502debc85facbb82 + .png": "/assets/05cff9c847adbe7d502debc85facbb82.png = 05cff9c847adbe7d502debc85facbb82 + .png",
"07a6cd0d34a0588ff268b93c257cb5c5.png = 07a6cd0d34a0588ff268b93c257cb5c5 + .png": "/assets/07a6cd0d34a0588ff268b93c257cb5c5.png = 07a6cd0d34a0588ff268b93c257cb5c5 + .png",
"331fda2135e5a8eea2daa000a75ce402.png = 331fda2135e5a8eea2daa000a75ce402 + .png": "/assets/331fda2135e5a8eea2daa000a75ce402.png = 331fda2135e5a8eea2daa000a75ce402 + .png",
"3bdb8d486ef00a56902e522f4a470bec.png = 3bdb8d486ef00a56902e522f4a470bec + .png": "/assets/3bdb8d486ef00a56902e522f4a470bec.png = 3bdb8d486ef00a56902e522f4a470bec + .png",
"47918a8a98d27e7a6d0d7553d4cafc53.png = 47918a8a98d27e7a6d0d7553d4cafc53 + .png": "/assets/47918a8a98d27e7a6d0d7553d4cafc53.png = 47918a8a98d27e7a6d0d7553d4cafc53 + .png",
"55a5c30d282234b6db2fbf8dda81a1e9.png = 55a5c30d282234b6db2fbf8dda81a1e9 + .png": "/assets/55a5c30d282234b6db2fbf8dda81a1e9.png = 55a5c30d282234b6db2fbf8dda81a1e9 + .png",
"66954465ea2a1a0b87ffe39d4a01a19f.png = 66954465ea2a1a0b87ffe39d4a01a19f + .png": "/assets/66954465ea2a1a0b87ffe39d4a01a19f.png = 66954465ea2a1a0b87ffe39d4a01a19f + .png",
"7bf95d737c9c9e204456178f0cffe103.png = 7bf95d737c9c9e204456178f0cffe103 + .png": "/assets/7bf95d737c9c9e204456178f0cffe103.png = 7bf95d737c9c9e204456178f0cffe103 + .png",
"dbb155635a448338eb46ae145ca05ce4.png = dbb155635a448338eb46ae145ca05ce4 + .png": "/assets/dbb155635a448338eb46ae145ca05ce4.png = dbb155635a448338eb46ae145ca05ce4 + .png",
"f18c25483b294bd311fd50dcf39dde24.png = f18c25483b294bd311fd50dcf39dde24 + .png": "/assets/f18c25483b294bd311fd50dcf39dde24.png = f18c25483b294bd311fd50dcf39dde24 + .png",
"f27101b6d1780b3d7be4ef2e4252567f.png = f27101b6d1780b3d7be4ef2e4252567f + .png": "/assets/f27101b6d1780b3d7be4ef2e4252567f.png = f27101b6d1780b3d7be4ef2e4252567f + .png",
"favicon.ico = favicon + .ico": "/assets/favicon.ico = favicon + .ico",
"flvVideo.js = flvVideo + .js": "/assets/flvVideo.js = flvVideo + .js",
"hlsVideo.js = hlsVideo + .js": "/assets/hlsVideo.js = hlsVideo + .js",
"icon.svg = icon + .svg": "/assets/icon.svg = icon + .svg",
"image-placeholder.svg = image-placeholder + .svg": "/assets/image-placeholder.svg = image-placeholder + .svg",
"nativehlsVideo.js = nativehlsVideo + .js": "/assets/nativehlsVideo.js = nativehlsVideo + .js",
"player.js = player + .js": "/assets/player.js = player + .js",
"[email protected] = site-placeholder@2x + .png": "/assets/[email protected] = site-placeholder@2x + .png"
}