2017-11-23 14:45:22 +01:00
|
|
|
import replace from 'rollup-plugin-replace';
|
2017-08-20 17:56:21 +02:00
|
|
|
import resolve from 'rollup-plugin-node-resolve';
|
2017-06-25 00:58:21 +02:00
|
|
|
import commonjs from 'rollup-plugin-commonjs';
|
|
|
|
import json from 'rollup-plugin-json';
|
|
|
|
import typescript from 'rollup-plugin-typescript';
|
2017-11-23 14:45:22 +01:00
|
|
|
import pkg from './package.json';
|
2017-06-25 00:58:21 +02:00
|
|
|
|
|
|
|
export default [
|
2018-12-22 06:42:44 +01:00
|
|
|
/* compiler.js */
|
2017-06-25 00:58:21 +02:00
|
|
|
{
|
2017-08-20 17:09:05 +02:00
|
|
|
input: 'src/index.ts',
|
2017-06-25 00:58:21 +02:00
|
|
|
plugins: [
|
2017-11-23 14:45:22 +01:00
|
|
|
replace({
|
|
|
|
__VERSION__: pkg.version
|
|
|
|
}),
|
2017-08-20 17:56:21 +02:00
|
|
|
resolve(),
|
2017-06-25 00:58:21 +02:00
|
|
|
commonjs(),
|
|
|
|
json(),
|
|
|
|
typescript({
|
|
|
|
include: 'src/**',
|
2018-12-16 01:18:03 +01:00
|
|
|
exclude: 'src/internal/**',
|
2017-06-25 00:58:21 +02:00
|
|
|
typescript: require('typescript')
|
|
|
|
})
|
|
|
|
],
|
2017-08-20 17:09:05 +02:00
|
|
|
output: {
|
2018-12-16 01:18:03 +01:00
|
|
|
file: 'compiler.js',
|
2017-08-20 17:09:05 +02:00
|
|
|
format: 'umd',
|
|
|
|
name: 'svelte',
|
|
|
|
sourcemap: true
|
|
|
|
}
|
2017-06-25 00:58:21 +02:00
|
|
|
},
|
|
|
|
|
2018-04-30 02:25:12 +02:00
|
|
|
/* cli/*.js */
|
|
|
|
{
|
2018-04-30 02:39:35 +02:00
|
|
|
input: ['src/cli/index.ts'],
|
2018-04-30 02:25:12 +02:00
|
|
|
output: {
|
|
|
|
dir: 'cli',
|
2018-05-16 22:11:37 +02:00
|
|
|
format: 'cjs',
|
|
|
|
paths: {
|
2018-12-16 01:18:03 +01:00
|
|
|
svelte: '../compiler.js'
|
2018-05-16 22:11:37 +02:00
|
|
|
}
|
2018-04-30 02:25:12 +02:00
|
|
|
},
|
|
|
|
external: ['fs', 'path', 'os', 'svelte'],
|
|
|
|
plugins: [
|
|
|
|
json(),
|
|
|
|
commonjs(),
|
2018-04-30 02:39:35 +02:00
|
|
|
resolve(),
|
|
|
|
typescript({
|
|
|
|
typescript: require('typescript')
|
|
|
|
})
|
2018-04-30 02:25:12 +02:00
|
|
|
],
|
|
|
|
experimentalCodeSplitting: true
|
|
|
|
},
|
|
|
|
|
2018-12-22 06:42:44 +01:00
|
|
|
/* index.js */
|
|
|
|
{
|
|
|
|
input: 'index.mjs',
|
|
|
|
output: {
|
|
|
|
file: 'index.js',
|
|
|
|
format: 'cjs'
|
|
|
|
},
|
|
|
|
external: name => name !== 'index.mjs'
|
|
|
|
},
|
|
|
|
|
|
|
|
/* internal.[m]js */
|
2017-06-25 00:58:21 +02:00
|
|
|
{
|
2018-12-16 01:18:03 +01:00
|
|
|
input: 'src/internal/index.js',
|
2018-12-22 06:42:44 +01:00
|
|
|
output: [
|
|
|
|
{
|
|
|
|
file: 'internal.mjs',
|
|
|
|
format: 'esm'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
file: 'internal.js',
|
|
|
|
format: 'cjs'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
/* store.js */
|
|
|
|
{
|
|
|
|
input: 'store.mjs',
|
2017-08-20 17:09:05 +02:00
|
|
|
output: {
|
2018-12-22 06:42:44 +01:00
|
|
|
file: 'store.js',
|
|
|
|
format: 'cjs'
|
|
|
|
},
|
|
|
|
external: name => name !== 'store.mjs'
|
|
|
|
},
|
2017-06-25 00:58:21 +02:00
|
|
|
];
|