-
Notifications
You must be signed in to change notification settings - Fork 5
/
rollup.config.mjs
51 lines (49 loc) · 1.21 KB
/
rollup.config.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
42
43
44
45
46
47
48
49
50
51
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from '@rollup/plugin-node-resolve';
import vulcanize from './rollup/vulcanize.js';
import { dts } from "rollup-plugin-dts";
import replace from "@rollup/plugin-replace";
import cleanup from 'rollup-plugin-cleanup';
const pjson = require('./package.json');
const forRelease = process.env.NODE_ENV === 'production';
export default [
{
input: 'rollup/vidyano.ts',
external: ['String', "__decorate"],
plugins: [
nodeResolve(),
commonjs(),
vulcanize(),
replace({
"moment$1 as moment": "moment",
"vidyano-latest-version": pjson.version,
"process.env.NODE_ENV": "'production'",
preventAssignment: true
}),
forRelease ? cleanup({
comments: "none"
}) : null
],
output: [{ file: 'vidyano.js' }, { file: "wwwroot/dist/vidyano.js" }],
watch: {
chokidar: {
usePolling: true,
interval: 5000
}
}
},
{
input: 'rollup/vidyano.ts',
external: ["tslib"],
plugins: [
dts({
respectExternal: true
}),
replace({
"moment_d as moment": "moment",
preventAssignment: true
})
],
output: [{ file: "vidyano.d.ts", format: "es" }, { file: "wwwroot/dist/vidyano.d.ts", format: "es" }],
}
];