mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-08-03 19:38:36 -04:00
Really fix rollup
This commit is contained in:
parent
2e22b28bd7
commit
1fd94b4b5c
@ -68,15 +68,21 @@ if (process.env.BUILD === 'production') {
|
|||||||
{
|
{
|
||||||
src: ['KiwixWebApp*.jsproj'],
|
src: ['KiwixWebApp*.jsproj'],
|
||||||
dest: 'dist',
|
dest: 'dist',
|
||||||
|
// Modify the jsproj included files
|
||||||
transform: (contents, filename) => contents.toString()
|
transform: (contents, filename) => contents.toString()
|
||||||
// Replace the entry point with the bundle
|
// Replace the entry point with the bundle
|
||||||
.replace(/(www[\\/]js[\\/])app.js/, '$1bundle.min.js')
|
.replace(/(www[\\/]js[\\/])app.js/, '$1bundle.min.js')
|
||||||
// Remove all the lib files that will be included in the bundle
|
// Remove all the lib files that will be included in the bundle
|
||||||
.replace(/(?:<Content Include=)?['"]www[\\/]js[\\/]lib[\\/]cache[\s\S]+zimfile.js['"](?:\s*\/>|,)\s*/, '')
|
.replace(/(?:<Content Include=)?["']www[\\/]js[\\/]lib[\\/]cache[\s\S]+zimfile.js["'](?:\s*\/>|,)\s*/, '')
|
||||||
|
// Replace any references to node_modules
|
||||||
|
.replace(/node_modules[\\/].*dist[\\/]((?:js|css)[\\/])?/g, function (m, p1) {
|
||||||
|
p1 = p1 || 'js/';
|
||||||
|
return 'www/' + p1;
|
||||||
|
})
|
||||||
// Alter remaining lib references
|
// Alter remaining lib references
|
||||||
.replace(/([\\/])js[\\/]lib/g, '$1js')
|
.replace(/([\\/])js[\\/]lib/g, '$1js')
|
||||||
// Remove unneeded ASM/WASM binaries
|
// Remove unneeded ASM/WASM binaries
|
||||||
.replace(/["']www[\\/]js[\\/].*dec.*js["'],\s*/g, '')
|
.replace(/['"]www[\\/]js[\\/].*dec.*js['"],\s*/g, '')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: ['service-worker.js'],
|
src: ['service-worker.js'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user