-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
98 lines (89 loc) · 2.66 KB
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// rollup.config.js
//import * as fs from 'fs';
import resolve from '@rollup/plugin-node-resolve';
import svelte from 'rollup-plugin-svelte';
//import { scss } from 'svelte-preprocess';
import babel from 'rollup-plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
export default {
input: 'src/typeahead.svelte',
output: {
sourcemap: false,
format: 'iife',
name: 'Typeahead',
file: 'dist/typeahead_svelte.js',
// globals: {
// 'svelte': 'svelte',
// 'svelte/internal': 'internal'
// }
},
plugins: [
svelte({
// By default, all .svelte and .html files are compiled
// extensions: ['.my-custom-extension'],
dev: false,
// You can restrict which files are compiled
// using `include` and `exclude`
// include: 'src/**/*.svelte',
// By default, the client-side compiler is used. You
// can also use the server-side rendering compiler
// generate: 'ssr',
// Optionally, preprocess components with svelte.preprocess:
// https://svelte.dev/docs#svelte_preprocess
// preprocess: [
// scss({ }),
// ],
// Emit CSS as "files" for other plugins to process
// emitCss: false,
// Extract CSS into a separate file (recommended).
// See note below
/* css: function (css) {
// console.log(css.code); // the concatenated CSS
// console.log(css.map); // a sourcemap
// creates `main.css` and `main.css.map` — pass `false`
// as the second argument if you don't want the sourcemap
css.write('dist/typeahead_svelte.css', false);
},
*/
// Warnings are normally passed straight to Rollup. You can
// optionally handle them here, for example to squelch
// warnings with a particular code
/*
onwarn: (warning, handler) => {
// e.g. don't warn on <marquee> elements, cos they're cool
if (warning.code === 'a11y-distracting-elements') return;
// let Rollup handle all other warnings normally
handler(warning);
}
*/
}),
resolve(),
commonjs(),
babel({
extensions: [ '.js', '.mjs', '.html', '.svelte' ],
runtimeHelpers: true,
exclude: [ 'node_modules/@babel/**', 'node_modules/core-js/**' ],
presets: [
[
'@babel/preset-env',
// {
// targets: {
// ie: '11'
// },
// useBuiltIns: 'usage',
// corejs: 3
// }
]
],
plugins: [
'@babel/plugin-syntax-dynamic-import',
[
'@babel/plugin-transform-runtime',
{
useESModules: true
}
]
]
}),
]
}