mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-12 13:50:01 -04:00
fix infinite bundle size bug
This commit is contained in:
parent
3539de7c18
commit
6c6ace4336
5 changed files with 475 additions and 1014 deletions
|
@ -19,8 +19,8 @@ const transform = options => {
|
|||
return {
|
||||
name: 'esbuild-sw-transformer',
|
||||
setup(build) {
|
||||
if (_fs.existsSync("./sw.js"))
|
||||
fs.rm("./sw.js");
|
||||
if (_fs.existsSync("./filemap.js"))
|
||||
fs.rm("./filemap.js");
|
||||
build.onResolve({ filter }, args => {
|
||||
const realPath = args.path.replace(filter, '');
|
||||
return {
|
||||
|
@ -68,9 +68,9 @@ const transform = options => {
|
|||
};
|
||||
|
||||
build({
|
||||
entryPoints: ['../public/sw.js'],
|
||||
entryPoints: ['../filemap.js'],
|
||||
bundle: true,
|
||||
outfile: 'sw.js',
|
||||
outfile: 'filemap.js',
|
||||
plugins: [
|
||||
// Always include this plugin before others
|
||||
transform()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue