-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
38 lines (36 loc) · 1.04 KB
/
rollup.config.js
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
import typescript from 'rollup-plugin-typescript2'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import sass from 'rollup-plugin-sass'
import excludeDependenciesFromBundle from "rollup-plugin-exclude-dependencies-from-bundle"
import postcss from 'rollup-plugin-postcss'
const postcssConfig = require('./postcss.config')
const overrides = {
compilerOptions: { declaration: true },
exclude: ["src/**/*.test.tsx", "src/**/*.stories.tsx", "src/**/*.stories.mdx", "setupTests.ts"]
}
const config = {
input: 'src/index.tsx',
output: [
{
file: 'dist/index.es.js',
format: 'es'
}
],
plugins: [
nodeResolve(),
commonjs(),
json(),
excludeDependenciesFromBundle(),
typescript({ tsconfigOverride: overrides }),
sass({ output: 'dist/index.css' }),
postcss({
extract: true,
//新增
plugins: postcssConfig.plugins
})
],
// external: ['react', 'react-dom', 'axios']
}
export default config