-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrollup.config.app.mjs
41 lines (39 loc) · 1.25 KB
/
rollup.config.app.mjs
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
import html from '@open-wc/rollup-plugin-html';
import commonjs from '@rollup/plugin-commonjs';
import nodeResolve from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import typescript from '@rollup/plugin-typescript';
import browsersync from 'rollup-plugin-browsersync';
import del from 'rollup-plugin-delete';
import dotenv from 'rollup-plugin-dotenv';
import autoExternal from 'rollup-plugin-auto-external';
import packageJson from './package.json' assert { type: 'json' };
export default {
preserveSymlinks: true,
preserveEntrySignatures: false,
input: 'examples/app/index.html',
output: { dir: 'build', format: 'esm' },
// external: ['react-router', 'scheduler'],
plugins: [
del({ targets: 'build' }),
typescript({
declaration: false,
declarationDir: null,
}),
commonjs(),
nodeResolve(),
dotenv(), // should happen before replace plugin
replace({
BUILD_VERSION: JSON.stringify(packageJson.version),
preventAssignment: true,
'process.env.NODE_ENV': JSON.stringify('development'),
'process.env': JSON.stringify(process.env),
delimiters: ['', ''],
}),
html(),
browsersync({
server: 'build',
single: true, // requires for routing
}),
],
};