-
-
Notifications
You must be signed in to change notification settings - Fork 50
/
rollup.config.js
172 lines (170 loc) · 4.92 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
const { babel } = require('@rollup/plugin-babel');
const commonjs = require('@rollup/plugin-commonjs');
const { nodeResolve } = require('@rollup/plugin-node-resolve');
const terser = require('@rollup/plugin-terser');
const postcss = require('rollup-plugin-postcss');
const autoprefixer = require('autoprefixer');
const tailwindcss = require('tailwindcss');
const colors = require('tailwindcss/colors');
const plugin = require('tailwindcss/plugin');
const tailwindConfig = {
theme: {
extend: {
boxShadow: {
DEFAULT: '0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.02)',
md: '0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.02)',
lg: '0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.01)',
xl: '0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.01)',
},
colors: {
'primary-50': 'var(--color-primary-50)',
'primary-100': 'var(--color-primary-100)',
'primary-200': 'var(--color-primary-200)',
'primary-300': 'var(--color-primary-300)',
'primary-400': 'var(--color-primary-400)',
'primary-500': 'var(--color-primary-500)',
'primary-600': 'var(--color-primary-600)',
'primary-700': 'var(--color-primary-700)',
'primary-800': 'var(--color-primary-800)',
'primary-900': 'var(--color-primary-900)',
'primary': 'var(--color-primary-500)',
'primary-hover': 'var(--color-primary-600)',
'primary-light': 'var(--color-primary-300)',
accent: 'var(--color-accent)',
light: 'var(--color-light)',
'light-hover': 'var(--color-light-hover)',
gray: colors.slate,
'light-blue': colors.sky,
red: colors.rose,
},
outline: {
blue: '2px solid rgba(0, 112, 244, 0.5)',
},
fontFamily: {
inter: ['Inter', 'sans-serif'],
},
fontSize: {
xs: ['0.75rem', { lineHeight: '1.5' }],
sm: ['0.875rem', { lineHeight: '1.5715' }],
base: ['1rem', { lineHeight: '1.5', letterSpacing: '-0.01em' }],
lg: ['1.125rem', { lineHeight: '1.5', letterSpacing: '-0.01em' }],
xl: ['1.25rem', { lineHeight: '1.5', letterSpacing: '-0.01em' }],
'2xl': ['1.5rem', { lineHeight: '1.33', letterSpacing: '-0.01em' }],
'3xl': ['1.88rem', { lineHeight: '1.33', letterSpacing: '-0.01em' }],
'4xl': ['2.25rem', { lineHeight: '1.25', letterSpacing: '-0.02em' }],
'5xl': ['3rem', { lineHeight: '1.25', letterSpacing: '-0.02em' }],
'6xl': ['3.75rem', { lineHeight: '1.2', letterSpacing: '-0.02em' }],
},
screens: {
xs: '480px',
},
borderWidth: {
3: '3px',
},
minWidth: {
36: '9rem',
44: '11rem',
56: '14rem',
60: '15rem',
72: '18rem',
80: '20rem',
},
maxWidth: {
'8xl': '88rem',
'9xl': '96rem',
},
zIndex: {
60: '60',
},
},
},
plugins: [
// eslint-disable-next-line global-require
require('@tailwindcss/forms'),
// add custom variant for expanding sidebar
plugin(({ addVariant, e }) => {
addVariant('sidebar-expanded', ({ modifySelectors, separator }) => {
modifySelectors(({ className }) => `.sidebar-expanded .${e(`sidebar-expanded${separator}${className}`)}`);
});
}),
],
}
module.exports = [
{
input: './styles/globals.scss',
output: {
file: './fief/static/admin.css'
},
plugins: [
postcss({
plugins: [
tailwindcss({
config: {
...tailwindConfig,
content: [
'./fief/templates/admin/**/*.html',
'./fief/templates/macros/**/*.html',
],
},
}),
autoprefixer(),
],
extract: true,
minimize: true,
}),
],
},
{
input: './styles/globals.scss',
output: {
file: './fief/static/auth.css'
},
plugins: [
postcss({
plugins: [
tailwindcss({
config: {
...tailwindConfig,
content: [
'./fief/templates/auth/**/*.html',
'./fief/templates/macros/**/*.html',
],
},
}),
autoprefixer(),
],
extract: true,
minimize: true,
}),
],
},
{
input: './js/code-editor.mjs',
output: {
file: './fief/static/code-editor.bundle.js',
format: 'iife',
},
plugins: [
nodeResolve(),
babel({
babelHelpers: 'runtime',
plugins: [
['@babel/plugin-transform-runtime', { useESModules: false }]
],
}),
terser(),
],
},
{
input: './js/dependencies.mjs',
output: {
file: './fief/static/dependencies.bundle.js',
format: 'iife',
},
plugins: [
commonjs(),
nodeResolve(),
terser(),
],
},
];