-
Notifications
You must be signed in to change notification settings - Fork 36
incomplete manifest when webpack --watch #11
Comments
Thanks for the report! I have some ideas on how to fix this, but i'm short on time at the moment. I'll try to get back to this ASAP. |
@gizocz pardon my stupid question, but why would you use manifest in development mode? I assume you are developing when you are watching for file changes? |
I'm developing the offline app, so I would like to have the manifest also On Tue, Dec 15, 2015 at 2:36 PM, Lars Rye Jeppesen <[email protected]
|
same problem here... missing all "assets" (file-loader, CopyWebpackPlugin) @--watch at build-nr >= 2 thx! |
Maybe. If someone needs, I build my own small (typescript) loader as a workaround (compiler: Compiler) =>
{
let cachedAssets: string[] = []
compiler.hooks.emit.tap('compilation', async (compilation: webpack.compilation.Compilation) =>
{
cachedAssets = [...cachedAssets, ...Object.keys(compilation.assets)
.map((filePath: string) => encodeURI(filePath))
.filter((filePath: string) => (
cachedAssets.indexOf(filePath) == -1 &&
!filePath.match(/.+\.map$/) &&
!filePath.match(/.+\.hot-update\.(json|js)$/)
))]
.sort()
promisify(writeFile)('dist/public/appcache.manifest', `CACHE MANIFEST\n\n${cachedAssets.join('\n')}\n\nNETWORK:\n*\n`)
})
}, |
When webpack started with --watch option, the plugin generate full manifest for the first time (OK), but when a watched fie is changed and webpack regenerate outputs, the plugin regenerate the appcache manifest, but it contains only changed files. Unchanged files processed with file-loader are not included nor files from copy-webpack-plugin.
The text was updated successfully, but these errors were encountered: