@ -9,10 +9,19 @@ import pkg from './package.json';
constis_publish=!!process.env.PUBLISH;
consttsPlugin=is_publish
?typescript({
include:'src/**',
typescript:require('typescript')
})
:sucrase({
transforms:['typescript']
});
exportdefault[
/* internal.[m]js */
{
input:`src/internal/index.js`,
input:`src/internal/index.ts`,
output:[
{
file:`internal.mjs`,
@ -26,19 +35,22 @@ export default [
}
],
external:id=>id.startsWith('svelte/'),
plugins:[{
generateBundle(options,bundle){
constmod=bundle['internal.mjs'];
if(mod){
fs.writeFileSync('src/compile/internal-exports.ts',`// This file is automatically generated\nexport default new Set(${JSON.stringify(mod.exports)});`);
plugins:[
tsPlugin,
{
generateBundle(options,bundle){
constmod=bundle['internal.mjs'];
if(mod){
fs.writeFileSync('src/compile/internal-exports.ts',`// This file is automatically generated\nexport default new Set(${JSON.stringify(mod.exports)});`);