This repository was archived by the owner on Oct 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrollup.config.js
76 lines (73 loc) · 1.77 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import commonjs from '@rollup/plugin-commonjs';
import scss from 'rollup-plugin-scss';
import vue from 'rollup-plugin-vue';
import svg from 'rollup-plugin-vue-inline-svg';
import esbuild from 'rollup-plugin-esbuild';
import resolve from '@rollup/plugin-node-resolve';
import filesize from 'rollup-plugin-filesize';
import alias from '@rollup/plugin-alias';
import { visualizer } from 'rollup-plugin-visualizer';
import del from 'rollup-plugin-delete';
import postcss from 'postcss';
// PostCSS plugins
import tailwindcss from 'tailwindcss';
import autoprefixer from 'autoprefixer';
import assets from 'postcss-assets';
module.exports = {
input: {
index: 'src/index.js',
// Code split components that rely on larger third party packages to facilitate code chunking in consuming libraries
ChecLineChart: 'src/components/ChecLineChart.vue',
ChecWysiwyg: 'src/components/ChecWysiwyg.vue',
},
output: {
dir: 'dist',
format: 'esm',
exports: 'named',
sourcemap: true,
},
plugins: [
del({
targets: 'dist/*',
}),
alias({
entries: [
{ find: '@', replacement: `${__dirname}/src` },
],
}),
scss({
output: 'dist/bundle.css',
sourceMap: true,
outputStyle: 'compressed',
processor: () => postcss([
tailwindcss,
autoprefixer,
assets,
]),
}),
svg(),
vue({
css: false,
preprocessStyles: true,
template: {
isProduction: true,
},
style: {
postcssPlugins: [
tailwindcss,
autoprefixer,
assets,
],
},
}),
esbuild({
target: 'es2019',
minify: true,
}),
commonjs(),
resolve(),
filesize(),
visualizer(),
],
external: [/@babel\/runtime/, 'vue'],
};