|
|
|
@ -9,16 +9,19 @@ const src = path.resolve( 'src' );
|
|
|
|
|
export default {
|
|
|
|
|
entry: 'src/index.ts',
|
|
|
|
|
moduleName: 'svelte',
|
|
|
|
|
targets: [
|
|
|
|
|
{ dest: 'compiler/svelte.js', format: 'umd' }
|
|
|
|
|
],
|
|
|
|
|
targets: [{ dest: 'compiler/svelte.js', format: 'umd' }],
|
|
|
|
|
plugins: [
|
|
|
|
|
{
|
|
|
|
|
resolveId(importee, importer) {
|
|
|
|
|
// bit of a hack — TypeScript only really works if it can resolve imports,
|
|
|
|
|
// but they misguidedly chose to reject imports with file extensions. This
|
|
|
|
|
// means we need to resolve them here
|
|
|
|
|
if ( importer && importer.startsWith( src ) && importee[0] === '.' && path.extname( importee ) === '' ) {
|
|
|
|
|
if (
|
|
|
|
|
importer &&
|
|
|
|
|
importer.startsWith(src) &&
|
|
|
|
|
importee[0] === '.' &&
|
|
|
|
|
path.extname(importee) === ''
|
|
|
|
|
) {
|
|
|
|
|
return path.resolve(path.dirname(importer), `${importee}.ts`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|