-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
45 lines (42 loc) · 1.13 KB
/
rollup.config.js
File metadata and controls
45 lines (42 loc) · 1.13 KB
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 nodeResolve from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import { rollupPluginHTML as html } from '@web/rollup-plugin-html';
import fs from 'fs';
const tsconfig = JSON.parse(fs.readFileSync('./tsconfig.json', 'utf8'));
const demoTsconfig = {
...tsconfig,
compilerOptions: { ...tsconfig.compilerOptions, outDir: 'dist/demo' },
};
export default [
{
input: 'oscd-menu-open.ts',
output: {
sourcemap: true, // Add source map to build output
format: 'es', // ES module type export
dir: 'dist', // The build output folder
// preserveModules: true, // Keep directory structure and files
},
preserveEntrySignatures: 'strict', // leaves export of the plugin entry point
plugins: [
/** Resolve bare module imports */
nodeResolve(),
typescript(),
],
},
{
input: 'demo/index.html',
plugins: [
html({
input: 'demo/index.html',
minify: true,
}),
nodeResolve(),
typescript(demoTsconfig),
],
output: {
dir: 'dist/demo',
format: 'es',
sourcemap: true,
},
},
];