You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/rollup/rollup.config.main.js

37 lines
1.0 KiB

import path from 'path';
8 years ago
import nodeResolve from 'rollup-plugin-node-resolve';
8 years ago
import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';
import typescript from 'rollup-plugin-typescript';
8 years ago
const src = path.resolve( 'src' );
8 years ago
export default {
entry: 'src/index.ts',
8 years ago
moduleName: 'svelte',
targets: [
{ dest: 'compiler/svelte.js', format: 'umd' }
8 years ago
],
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 ) === '' ) {
return path.resolve( path.dirname( importer ), `${importee}.ts` );
}
}
},
8 years ago
nodeResolve({ jsnext: true, module: true }),
commonjs(),
json(),
typescript({
include: 'src/**',
exclude: 'src/shared/**',
typescript: require( 'typescript' )
})
8 years ago
],
sourceMap: true
8 years ago
};