-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrollup.config.webapp.js
81 lines (69 loc) · 1.89 KB
/
rollup.config.webapp.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
import resolve from 'rollup-plugin-node-resolve';
import json from 'rollup-plugin-json';
import commonjs from 'rollup-plugin-commonjs';
import svelte from 'rollup-plugin-svelte';
import includePaths from 'rollup-plugin-includepaths';
export default [
// photoshop container bundle
{
input: 'src/webapp/index.js',
output: {
file: "public/scripts/index.bundle.js",
format: 'iife'
},
plugins: [
json({
compact: true,
}),
//resolve node.js modules from node_modules
resolve(),
//set an include path so we can do simpler imports without needed to traverse up trees
includePaths({ paths: ["src/webapp", "src/plugin"], }),
// auto convert commonjs / modejs modues to es6 modules.
commonjs({
sourceMap: true, // default: true
}),
//trasnform svelte web components into their scripts
svelte({
include: 'src/**/*.svelte',
css: function (css) {
css.write('public/stylesheets/index.css');
}
}),
],
watch: {
clearScreen: true
}
},
// plugin bundle
{
input: 'src/webapp/plugin.js',
output: {
file: "public/scripts/plugin.bundle.js",
format: 'iife'
},
plugins: [
json({
compact: true,
}),
//resolve node.js modules from node_modules
resolve(),
//set an include path so we can do simpler imports without needed to traverse up trees
includePaths({ paths: ["src/webapp", "src/plugin"], }),
// auto convert commonjs / modejs modues to es6 modules.
commonjs({
sourceMap: true, // default: true
}),
//trasnform svelte web components into their scripts
svelte({
include: 'src/**/*.svelte',
css: function (css) {
css.write('public/stylesheets/plugin.css');
}
}),
],
watch: {
clearScreen: true
}
}
]