-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
49 lines (48 loc) · 1.27 KB
/
Copy pathrollup.config.js
File metadata and controls
49 lines (48 loc) · 1.27 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 path from 'path';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import postcss from 'rollup-plugin-postcss';
import terser from '@rollup/plugin-terser';
import copy from 'rollup-plugin-copy';
export default {
input: 'src/index.ts',
output: [
{
file: 'dist/react-ios-scroll-lock.js',
format: 'cjs',
exports: 'named',
sourcemap: false
},
{
file: 'dist/react-ios-scroll-lock.esm.js',
format: 'esm',
exports: 'named',
sourcemap: false
}
],
plugins: [
resolve(),
commonjs(),
typescript({
tsconfig: './tsconfig.json',
jsx: 'react',
declaration: true,
declarationDir: 'dist/types'
}),
postcss({
extract: path.resolve('dist/css/styles.css'),
minimize: true
}),
copy({
targets: [
{
src: 'src/css/index.js',
dest: 'dist/css'
}
]
}),
terser()
],
external: ['react', 'react-dom', 'react/jsx-runtime']
};