2020-04-28 19:40:05 +00:00
|
|
|
import svelte from 'rollup-plugin-svelte';
|
|
|
|
import resolve from '@rollup/plugin-node-resolve';
|
2021-04-29 18:06:25 +00:00
|
|
|
import typescript from '@rollup/plugin-typescript';
|
|
|
|
import sveltePreprocess from 'svelte-preprocess';
|
2020-04-28 19:40:05 +00:00
|
|
|
|
2021-04-30 07:01:30 +00:00
|
|
|
// Directories
|
|
|
|
const targetDir = 'dist';
|
|
|
|
const sourceDir = 'src';
|
2021-04-29 16:02:28 +00:00
|
|
|
|
2020-08-22 12:31:44 +00:00
|
|
|
// Create bundle
|
|
|
|
export default [
|
|
|
|
// Bundle everything
|
2021-04-30 17:10:03 +00:00
|
|
|
{
|
2021-05-14 18:39:12 +00:00
|
|
|
input: sourceDir + '/Icon.svelte',
|
2021-04-30 17:10:03 +00:00
|
|
|
output: [
|
2021-05-14 18:39:12 +00:00
|
|
|
{ file: targetDir + '/index.mjs', format: 'es' },
|
|
|
|
{ file: targetDir + '/index.js', format: 'cjs' },
|
2021-04-30 17:10:03 +00:00
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
svelte({
|
|
|
|
preprocess: sveltePreprocess(),
|
|
|
|
}),
|
|
|
|
resolve({
|
2021-09-27 13:29:45 +00:00
|
|
|
browser: true,
|
|
|
|
extensions: ['.ts', '.mjs', '.js', '.svelte'],
|
|
|
|
dedupe: ['svelte'],
|
2021-04-30 17:10:03 +00:00
|
|
|
}),
|
|
|
|
typescript(),
|
|
|
|
],
|
|
|
|
},
|
2020-08-22 12:31:44 +00:00
|
|
|
{
|
2021-05-14 18:39:12 +00:00
|
|
|
input: sourceDir + '/OfflineIcon.svelte',
|
2020-08-22 12:31:44 +00:00
|
|
|
output: [
|
2021-05-14 18:39:12 +00:00
|
|
|
{ file: targetDir + '/offline.mjs', format: 'es' },
|
|
|
|
{ file: targetDir + '/offline.js', format: 'cjs' },
|
2020-08-22 12:31:44 +00:00
|
|
|
],
|
2021-04-29 18:06:25 +00:00
|
|
|
plugins: [
|
|
|
|
svelte({
|
|
|
|
preprocess: sveltePreprocess(),
|
|
|
|
}),
|
|
|
|
resolve({
|
2021-09-27 13:29:45 +00:00
|
|
|
browser: true,
|
|
|
|
extensions: ['.ts', '.mjs', '.js', '.svelte'],
|
|
|
|
dedupe: ['svelte'],
|
2021-04-29 18:06:25 +00:00
|
|
|
}),
|
|
|
|
typescript(),
|
|
|
|
],
|
2020-08-22 12:31:44 +00:00
|
|
|
},
|
2021-05-14 18:39:12 +00:00
|
|
|
|
2021-04-30 17:10:03 +00:00
|
|
|
// Files included in Icon.svelte as bundle
|
|
|
|
{
|
|
|
|
input: sourceDir + '/functions.ts',
|
|
|
|
output: [
|
|
|
|
{
|
2022-01-24 17:44:10 +00:00
|
|
|
file: targetDir + '/functions.mjs',
|
2021-04-30 17:10:03 +00:00
|
|
|
format: 'es',
|
|
|
|
},
|
2022-01-24 17:44:10 +00:00
|
|
|
{
|
|
|
|
file: targetDir + '/functions.js',
|
|
|
|
format: 'cjs',
|
|
|
|
},
|
2021-04-30 17:10:03 +00:00
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
resolve({
|
2021-09-27 13:29:45 +00:00
|
|
|
extensions: ['.ts', '.mjs', '.js', '.svelte'],
|
|
|
|
dedupe: ['svelte'],
|
2021-04-30 17:10:03 +00:00
|
|
|
}),
|
|
|
|
typescript(),
|
|
|
|
],
|
|
|
|
},
|
2021-04-30 07:01:30 +00:00
|
|
|
// Files included in OfflineIcon.svelte as bundle
|
2020-08-22 12:31:44 +00:00
|
|
|
{
|
2021-04-30 07:01:30 +00:00
|
|
|
input: sourceDir + '/offline-functions.ts',
|
2020-08-22 12:31:44 +00:00
|
|
|
output: [
|
|
|
|
{
|
2022-01-24 17:44:10 +00:00
|
|
|
file: targetDir + '/offline-functions.mjs',
|
2020-08-22 12:31:44 +00:00
|
|
|
format: 'es',
|
|
|
|
},
|
2022-01-24 17:44:10 +00:00
|
|
|
{
|
|
|
|
file: targetDir + '/offline-functions.js',
|
|
|
|
format: 'cjs',
|
|
|
|
},
|
2020-08-22 12:31:44 +00:00
|
|
|
],
|
2021-04-29 18:06:25 +00:00
|
|
|
plugins: [
|
|
|
|
resolve({
|
2021-09-27 13:29:45 +00:00
|
|
|
extensions: ['.ts', '.mjs', '.js', '.svelte'],
|
|
|
|
dedupe: ['svelte'],
|
2021-04-29 18:06:25 +00:00
|
|
|
}),
|
|
|
|
typescript(),
|
|
|
|
],
|
2020-08-22 12:31:44 +00:00
|
|
|
},
|
|
|
|
];
|