diff --git a/rollup/rollup.config.main.js b/rollup/rollup.config.main.js index cfb80b5d52..c9ab0f7394 100644 --- a/rollup/rollup.config.main.js +++ b/rollup/rollup.config.main.js @@ -4,22 +4,25 @@ import commonjs from 'rollup-plugin-commonjs'; import json from 'rollup-plugin-json'; import typescript from 'rollup-plugin-typescript'; -const src = path.resolve( 'src' ); +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 ) { + 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` ); + if ( + importer && + importer.startsWith(src) && + importee[0] === '.' && + path.extname(importee) === '' + ) { + return path.resolve(path.dirname(importer), `${importee}.ts`); } } }, @@ -29,7 +32,7 @@ export default { typescript({ include: 'src/**', exclude: 'src/shared/**', - typescript: require( 'typescript' ) + typescript: require('typescript') }) ], sourceMap: true diff --git a/rollup/rollup.config.ssr.js b/rollup/rollup.config.ssr.js index e44315af38..6f9e9f6fe6 100644 --- a/rollup/rollup.config.ssr.js +++ b/rollup/rollup.config.ssr.js @@ -6,9 +6,7 @@ import buble from 'rollup-plugin-buble'; export default { entry: 'src/server-side-rendering/register.js', moduleName: 'svelte', - targets: [ - { dest: 'ssr/register.js', format: 'cjs' } - ], + targets: [{ dest: 'ssr/register.js', format: 'cjs' }], plugins: [ nodeResolve({ jsnext: true, module: true }), commonjs(), @@ -20,9 +18,9 @@ export default { } }) ], - external: [ path.resolve( 'src/index.ts' ), 'fs', 'path' ], + external: [path.resolve('src/index.ts'), 'fs', 'path'], paths: { - [ path.resolve( 'src/index.ts' ) ]: '../compiler/svelte.js' + [path.resolve('src/index.ts')]: '../compiler/svelte.js' }, sourceMap: true };