forked from zihan21206/micro-parsons-element
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrollup.config.js
More file actions
49 lines (45 loc) · 1.31 KB
/
rollup.config.js
File metadata and controls
49 lines (45 loc) · 1.31 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
46
47
48
49
import typescript from '@rollup/plugin-typescript';
import commonjs from '@rollup/plugin-commonjs';
import css from 'rollup-plugin-import-css';
import json from '@rollup/plugin-json';
import terser from '@rollup/plugin-terser';
import {createRequire} from 'node:module';
import externals from 'rollup-plugin-node-externals'; // comment out when packing dependencies for local testing
import {nodeResolve} from '@rollup/plugin-node-resolve';
const require = createRequire(import.meta.url);
const pkg = require('./package.json');
const INPUTS = [
'micro-parsons'
];
export default INPUTS.map((input) => {
return {
input: `./bin/${input}.js`,
output: {
file: `./${input}/${input}.js`,
format: 'esm',
sourcemap: true,
esModule: true,
interop: 'auto',
},
plugins: [
terser(),
// filesize({
// showMinifiedSize: false,
// showBeforeSizes: 'build'
// }),
typescript(),
// nodePolyfills(),
commonjs(),
css(),
json(),
// externals({ // comment out when packing dependencies for local testing
// include:'highlight.js/lib/languages/sql'
// }),
nodeResolve()
],
context: 'window',
// external: [ // comment out when packing dependencies for local testing
// '/node_modules/'
// ]
}
});