-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtsdx.config.js
More file actions
30 lines (29 loc) · 786 Bytes
/
tsdx.config.js
File metadata and controls
30 lines (29 loc) · 786 Bytes
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
const path = require('path');
const postcss = require('rollup-plugin-postcss');
const { terser } = require('rollup-plugin-terser');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
module.exports = {
rollup(config, options) {
config.plugins.push(
postcss({
modules: true,
onlyModules: true,
autoModules: false,
plugins: [
autoprefixer(),
cssnano({
preset: 'default',
}),
],
inject: false,
// only write out CSS for the first bundle (avoids pointless extra files):
// extract: !!options.writeMeta,
extract: path.resolve('dist/styles.min.css'),
minimize: true,
}),
terser()
);
return config;
},
};