pcb
pcb copied to clipboard
Watch mode, caches and plugins
In watch mode, on a second and following rebuilds offline-plugin
reports it cannot find index.html
or in output assets. index.html
is being added with html-webpack-plugin
. Same happens with assets added by copy-webpack-plugin
.
I experiences this issue.
In watch mode, when I changed my code, webpack doesn't reload page because of below warning:
[WDS] App updated. Recompiling...
[WDS] Warnings while compiling.
OfflinePlugin: Cache asset [./] is not found in the output assets,if it's an external asset, put it to the |externals| option to remove this warning
But I already add ./
to externals
:
new OfflinePlugin({
caches: {
main: ['./', 'main.js']
},
externals: ['./'],
ServiceWorker: {
events: true
},
AppCache: false
})
It actually should update even with this issue. It just may not work (offline capabilities).
I ran into this as well, but made it work by changing './'
to 'index.html'
and moving OfflinePlugin()
below HtmlWebpackPlugin()
in the plugin list.