-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.ssr.js
45 lines (37 loc) · 1.13 KB
/
rollup.config.ssr.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
import svelte from 'rollup-plugin-svelte'
import resolve from '@rollup/plugin-node-resolve'
import pkg from './package.json'
const name = pkg.name
.replace(/^(@\S+\/)?(svelte-)?(\S+)/, '$3')
.replace(/^\w/, m => m.toUpperCase())
.replace(/-\w/g, m => m[1].toUpperCase())
export default {
input: 'src/index.js',
output: [
{ file: pkg.module, 'format': 'es' },
{ file: pkg.main, 'format': 'umd', name }
],
plugins: [
svelte({
// By default, the client-side compiler is used. You
// can also use the server-side rendering compiler
generate: 'ssr',
// ensure that extra attributes are added to head
// elements for hydration (used with generate: 'ssr')
hydratable: true,
// Emit CSS as "files" for other plugins to process
emitCss: false,
// You can optionally set 'customElement' to 'true' to compile
// your components to custom elements (aka web elements)
customElement: false,
// Extract CSS into a single bundled file (recommended).
// See note below
css: function (css) {
css.write('button.css', false)
},
//svelte: require('svelte')
}
),
resolve()
]
}