-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.config.js
More file actions
42 lines (41 loc) · 1.05 KB
/
rollup.config.js
File metadata and controls
42 lines (41 loc) · 1.05 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
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import babel from '@rollup/plugin-babel';
import typescript from '@rollup/plugin-typescript';
import image from '@rollup/plugin-image';
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
import scss from 'rollup-plugin-scss';
//import postcss from 'rollup-plugin-postcss';
export default {
input: ['src/index.ts', 'src/index.scss'],
output: {
dir: 'dist',
format: 'cjs',
sourcemap: true,
// Remove the hash from the asset filename
assetFileNames: '[name][extname]',
},
plugins: [
peerDepsExternal(),
resolve(),
commonjs(),
typescript(),
babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**',
}),
// postcss({
// extract: true,
// modules: false,
// use: ['sass'],
// }),
scss({
fileName: 'styles.css',
input: 'src/index.scss',
failOnError: true,
css: { modules: false },
}),
image(),
],
external: ['react', 'react-dom'],
};