Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).then(bundle => {
cached[src] = bundle;
const jsFile = path.basename(dest);
const result = bundle.generate({
format: 'cjs',
sourceMap: true,
sourceMapFile: jsFile,
});
// Wrap code in self invoking function so the variables don't
// pollute the global namespace.
const isolatedCode = `(function () {${result.code}\n}());`;
return Promise.all([
jetpack.writeAsync(
dest,
`${isolatedCode}\n//# sourceMappingURL=${jsFile}.map`
),
jetpack.writeAsync(`${dest}.map`, result.map.toString()),
]);
});
};
}).then(result => {
// Wrap code in self invoking function so the constiables don't
// pollute the global namespace.
const isolatedCode = `(function () {${result.code}\n}());`;
return Promise.all([
jetpack.writeAsync(dest, `${isolatedCode}\n//# sourceMappingURL=${jsFile}.map`),
jetpack.writeAsync(`${dest}.map`, result.map.toString()),
]);
})
});
const png512 = await convert(svg, { width: 512, height: 512 });
const png1024 = await convert(svg, { width: 1024, height: 1024 });
const ico = await toIco([png16, png24, png32, png48, png64, png128, png256]);
const icns = await icnsConvert([png1024, png512, png256, png128, png64, png32, png16]);
await jetpack.writeAsync('src/public/images/icon.png', png64);
await jetpack.writeAsync('src/public/images/icon@2x.png', png128);
await jetpack.writeAsync('build/icon.ico', ico);
await jetpack.writeAsync('build/icon.icns', icns);
await jetpack.writeAsync('build/installerIcon.ico', ico);
await jetpack.writeAsync('build/uninstallerIcon.ico', ico);
await jetpack.writeAsync('build/appx/Square44x44Logo.png', png44);
await jetpack.writeAsync('build/appx/Square150x150Logo.png', png150);
await jetpack.writeAsync('build/appx/StoreLogo.png', png50);
await jetpack.writeAsync('build/appx/Wide310x150Logo.png', png310v150);
await jetpack.writeAsync('build/icons/512x512.png', png512);
});
await Promise.all((await fg(['dist/**/*.js'])).map(async path => {
const content = await jetpack.readAsync(path);
const replaced = content.replace(/from '(\.[^']+)';/g, "from '$1.js';");
await jetpack.writeAsync(path, replaced);
}));
}, { inputs: ['ts/**/*.ts'] });
const png48 = await convert(svg, { width: 48, height: 48 });
const png50 = await convert(svg, { width: 50, height: 50 });
const png64 = await convert(svg, { width: 64, height: 64 });
const png128 = await convert(svg, { width: 128, height: 128 });
const png150 = await convert(svg, { width: 150, height: 150 });
const png310v150 = await convert(svg, { width: 310, height: 150 });
const png256 = await convert(svg, { width: 256, height: 256 });
const png512 = await convert(svg, { width: 512, height: 512 });
const png1024 = await convert(svg, { width: 1024, height: 1024 });
const ico = await toIco([png16, png24, png32, png48, png64, png128, png256]);
const icns = await icnsConvert([png1024, png512, png256, png128, png64, png32, png16]);
await writeAsync('src/public/images/icon.png', png64);
await writeAsync('src/public/images/icon@2x.png', png128);
await writeAsync('build/icon.ico', ico);
await writeAsync('build/icon.icns', icns);
await writeAsync('build/installerIcon.ico', ico);
await writeAsync('build/uninstallerIcon.ico', ico);
await writeAsync('build/appx/Square44x44Logo.png', png44);
await writeAsync('build/appx/Square150x150Logo.png', png150);
await writeAsync('build/appx/StoreLogo.png', png50);
await writeAsync('build/appx/Wide310x150Logo.png', png310v150);
await writeAsync('build/icons/512x512.png', png512);
});
const png24 = await convert(svg, { width: 24, height: 24 });
const png32 = await convert(svg, { width: 32, height: 32 });
const png44 = await convert(svg, { width: 44, height: 44 });
const png48 = await convert(svg, { width: 48, height: 48 });
const png50 = await convert(svg, { width: 50, height: 50 });
const png64 = await convert(svg, { width: 64, height: 64 });
const png128 = await convert(svg, { width: 128, height: 128 });
const png150 = await convert(svg, { width: 150, height: 150 });
const png310v150 = await convert(svg, { width: 310, height: 150 });
const png256 = await convert(svg, { width: 256, height: 256 });
const png512 = await convert(svg, { width: 512, height: 512 });
const png1024 = await convert(svg, { width: 1024, height: 1024 });
const ico = await toIco([png16, png24, png32, png48, png64, png128, png256]);
const icns = await icnsConvert([png1024, png512, png256, png128, png64, png32, png16]);
await writeAsync('src/public/images/icon.png', png64);
await writeAsync('src/public/images/icon@2x.png', png128);
await writeAsync('build/icon.ico', ico);
await writeAsync('build/icon.icns', icns);
await writeAsync('build/installerIcon.ico', ico);
await writeAsync('build/uninstallerIcon.ico', ico);
await writeAsync('build/appx/Square44x44Logo.png', png44);
await writeAsync('build/appx/Square150x150Logo.png', png150);
await writeAsync('build/appx/StoreLogo.png', png50);
await writeAsync('build/appx/Wide310x150Logo.png', png310v150);
await writeAsync('build/icons/512x512.png', png512);
});
const png32 = await convert(svg, { width: 32, height: 32 });
const png44 = await convert(svg, { width: 44, height: 44 });
const png48 = await convert(svg, { width: 48, height: 48 });
const png50 = await convert(svg, { width: 50, height: 50 });
const png64 = await convert(svg, { width: 64, height: 64 });
const png128 = await convert(svg, { width: 128, height: 128 });
const png150 = await convert(svg, { width: 150, height: 150 });
const png310v150 = await convert(svg, { width: 310, height: 150 });
const png256 = await convert(svg, { width: 256, height: 256 });
const png512 = await convert(svg, { width: 512, height: 512 });
const png1024 = await convert(svg, { width: 1024, height: 1024 });
const ico = await toIco([png16, png24, png32, png48, png64, png128, png256]);
const icns = await icnsConvert([png1024, png512, png256, png128, png64, png32, png16]);
await jetpack.writeAsync('src/public/images/icon.png', png64);
await jetpack.writeAsync('src/public/images/icon@2x.png', png128);
await jetpack.writeAsync('build/icon.ico', ico);
await jetpack.writeAsync('build/icon.icns', icns);
await jetpack.writeAsync('build/installerIcon.ico', ico);
await jetpack.writeAsync('build/uninstallerIcon.ico', ico);
await jetpack.writeAsync('build/appx/Square44x44Logo.png', png44);
await jetpack.writeAsync('build/appx/Square150x150Logo.png', png150);
await jetpack.writeAsync('build/appx/StoreLogo.png', png50);
await jetpack.writeAsync('build/appx/Wide310x150Logo.png', png310v150);
await jetpack.writeAsync('build/icons/512x512.png', png512);
});
const png24 = await convert(svg, { width: 24, height: 24 });
const png32 = await convert(svg, { width: 32, height: 32 });
const png44 = await convert(svg, { width: 44, height: 44 });
const png48 = await convert(svg, { width: 48, height: 48 });
const png50 = await convert(svg, { width: 50, height: 50 });
const png64 = await convert(svg, { width: 64, height: 64 });
const png128 = await convert(svg, { width: 128, height: 128 });
const png150 = await convert(svg, { width: 150, height: 150 });
const png310v150 = await convert(svg, { width: 310, height: 150 });
const png256 = await convert(svg, { width: 256, height: 256 });
const png512 = await convert(svg, { width: 512, height: 512 });
const png1024 = await convert(svg, { width: 1024, height: 1024 });
const ico = await toIco([png16, png24, png32, png48, png64, png128, png256]);
const icns = await icnsConvert([png1024, png512, png256, png128, png64, png32, png16]);
await jetpack.writeAsync('src/public/images/icon.png', png64);
await jetpack.writeAsync('src/public/images/icon@2x.png', png128);
await jetpack.writeAsync('build/icon.ico', ico);
await jetpack.writeAsync('build/icon.icns', icns);
await jetpack.writeAsync('build/installerIcon.ico', ico);
await jetpack.writeAsync('build/uninstallerIcon.ico', ico);
await jetpack.writeAsync('build/appx/Square44x44Logo.png', png44);
await jetpack.writeAsync('build/appx/Square150x150Logo.png', png150);
await jetpack.writeAsync('build/appx/StoreLogo.png', png50);
await jetpack.writeAsync('build/appx/Wide310x150Logo.png', png310v150);
await jetpack.writeAsync('build/icons/512x512.png', png512);
});
const png150 = await convert(svg, { width: 150, height: 150 });
const png310v150 = await convert(svg, { width: 310, height: 150 });
const png256 = await convert(svg, { width: 256, height: 256 });
const png512 = await convert(svg, { width: 512, height: 512 });
const png1024 = await convert(svg, { width: 1024, height: 1024 });
const ico = await toIco([png16, png24, png32, png48, png64, png128, png256]);
const icns = await icnsConvert([png1024, png512, png256, png128, png64, png32, png16]);
await jetpack.writeAsync('src/public/images/icon.png', png64);
await jetpack.writeAsync('src/public/images/icon@2x.png', png128);
await jetpack.writeAsync('build/icon.ico', ico);
await jetpack.writeAsync('build/icon.icns', icns);
await jetpack.writeAsync('build/installerIcon.ico', ico);
await jetpack.writeAsync('build/uninstallerIcon.ico', ico);
await jetpack.writeAsync('build/appx/Square44x44Logo.png', png44);
await jetpack.writeAsync('build/appx/Square150x150Logo.png', png150);
await jetpack.writeAsync('build/appx/StoreLogo.png', png50);
await jetpack.writeAsync('build/appx/Wide310x150Logo.png', png310v150);
await jetpack.writeAsync('build/icons/512x512.png', png512);
});
const png50 = await convert(svg, { width: 50, height: 50 });
const png64 = await convert(svg, { width: 64, height: 64 });
const png128 = await convert(svg, { width: 128, height: 128 });
const png150 = await convert(svg, { width: 150, height: 150 });
const png310v150 = await convert(svg, { width: 310, height: 150 });
const png256 = await convert(svg, { width: 256, height: 256 });
const png512 = await convert(svg, { width: 512, height: 512 });
const png1024 = await convert(svg, { width: 1024, height: 1024 });
const ico = await toIco([png16, png24, png32, png48, png64, png128, png256]);
const icns = await icnsConvert([png1024, png512, png256, png128, png64, png32, png16]);
await writeAsync('src/public/images/icon.png', png64);
await writeAsync('src/public/images/icon@2x.png', png128);
await writeAsync('build/icon.ico', ico);
await writeAsync('build/icon.icns', icns);
await writeAsync('build/installerIcon.ico', ico);
await writeAsync('build/uninstallerIcon.ico', ico);
await writeAsync('build/appx/Square44x44Logo.png', png44);
await writeAsync('build/appx/Square150x150Logo.png', png150);
await writeAsync('build/appx/StoreLogo.png', png50);
await writeAsync('build/appx/Wide310x150Logo.png', png310v150);
await writeAsync('build/icons/512x512.png', png512);
});