Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #113 from lukeed/feat/map-config
Browse files Browse the repository at this point in the history
Consolidate Rollup config file
  • Loading branch information
Rich-Harris authored Feb 6, 2018
2 parents 7dbcab7 + 08e575f commit a85f292
Showing 1 changed file with 22 additions and 86 deletions.
108 changes: 22 additions & 86 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,91 +11,27 @@ const paths = {
'sapper/core.js': './core.js'
};

export default [
// cli.js
{
input: 'src/cli/index.ts',
output: {
file: 'cli.js',
format: 'cjs',
banner: '#!/usr/bin/env node',
paths,
sourcemap: true
},
external,
plugins: [
typescript({
typescript: require('typescript')
})
]
},

// core.js
{
input: 'src/core/index.ts',
output: {
file: 'core.js',
format: 'cjs',
banner: '#!/usr/bin/env node',
paths,
sourcemap: true
},
external,
plugins: [
typescript({
typescript: require('typescript')
})
]
},
const plugins = [
typescript({
typescript: require('typescript')
})
];

// middleware.js
{
input: 'src/middleware/index.ts',
output: {
file: 'middleware.js',
format: 'cjs',
paths,
sourcemap: true
},
external,
plugins: [
typescript({
typescript: require('typescript')
})
]
},

// runtime.js
{
input: 'src/runtime/index.ts',
output: {
file: 'runtime.js',
format: 'es',
paths,
sourcemap: true
},
external,
plugins: [
typescript({
typescript: require('typescript')
})
]
export default [
{ name: 'cli', banner: true },
{ name: 'core', banner: true },
{ name: 'middleware' },
{ name: 'runtime', format: 'es' },
{ name: 'webpack', file: 'webpack/config' }
].map(obj => ({
input: `src/${obj.name}/index.ts`,
output: {
file: `${obj.file || obj.name}.js`,
format: obj.format || 'cjs',
banner: obj.banner && '#!/usr/bin/env node',
paths,
sourcemap: true
},

// webpack/config.js
{
input: 'src/webpack/index.ts',
output: {
file: 'webpack/config.js',
format: 'cjs',
paths,
sourcemap: true
},
external,
plugins: [
typescript({
typescript: require('typescript')
})
]
}
];
external,
plugins
}));

0 comments on commit a85f292

Please sign in to comment.