-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
47 lines (45 loc) · 1.61 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
// see https://github.com/rozek/build-configuration-study
import svelte from 'rollup-plugin-svelte'
import commonjs from '@rollup/plugin-commonjs'
import resolve from '@rollup/plugin-node-resolve'
import autoPreprocess from 'svelte-preprocess'
import typescript from '@rollup/plugin-typescript'
import postcss from 'rollup-plugin-postcss'
import saveToFile from 'save-to-file'
export default {
input: './src/index.ts',
external: [
'javascript-interface-library', 'locally-unique-id-generator',
'svelte-device-info', 'svelte-coordinate-conversion',
'svelte-drag-and-drop-actions'
],
output: [
{
file: './dist/svelte-sortable-flat-list-view.js',
format: 'umd', // builds for both Node.js and Browser
name: 'sortableFlatListView', // required for UMD modules
globals: {
'javascript-interface-library':'JIL',
'locally-unique-id-generator': 'newUniqueId',
'svelte-device-info': 'Device',
'svelte-coordinate-conversion':'Conversion',
'svelte-drag-and-drop-actions':'DragAndDropActions'
},
noConflict:true,
sourcemap: true,
exports: 'default',
},{
file: './dist/svelte-sortable-flat-list-view.esm.js',
format: 'esm',
sourcemap:true,
}
],
plugins: [
svelte({ preprocess:[
autoPreprocess({ aliases:[['ts','typescript']] }),
saveToFile('./dist/svelte-sortable-flat-list-view.svelte')
]}),
resolve({ browser:true, dedupe:['svelte'] }), commonjs(), typescript(),
postcss({ extract:false, inject:{insertAt:'top'} }),
],
};