Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

incomplete manifest when webpack --watch #11

Open
gizocz opened this issue Nov 14, 2015 · 5 comments
Open

incomplete manifest when webpack --watch #11

gizocz opened this issue Nov 14, 2015 · 5 comments

Comments

@gizocz
Copy link

gizocz commented Nov 14, 2015

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.

@lettertwo
Copy link
Owner

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.

@spock123
Copy link

@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?

@gizocz
Copy link
Author

gizocz commented Dec 16, 2015

I'm developing the offline app, so I would like to have the manifest also
during the development.

On Tue, Dec 15, 2015 at 2:36 PM, Lars Rye Jeppesen <[email protected]

wrote:

@gizocz https://github.com/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?


Reply to this email directly or view it on GitHub
#11 (comment)
.

@crazyx13th
Copy link

crazyx13th commented Feb 27, 2020

same problem here... missing all "assets" (file-loader, CopyWebpackPlugin) @--watch at build-nr >= 2

thx!

@crazyx13th
Copy link

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`)
 })
},

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants