-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathesbuild.config.js
More file actions
35 lines (33 loc) · 948 Bytes
/
esbuild.config.js
File metadata and controls
35 lines (33 loc) · 948 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
31
32
33
34
35
const alias = require('esbuild-plugin-alias');
const stylePlugin = require('esbuild-style-plugin');
const autoprefixer = require('autoprefixer');
const tailwindcss = require('tailwindcss');
const tailwindcssNesting = require('tailwindcss/nesting');
require('esbuild').build({
entryPoints: ['main.js'],
bundle: true,
minify: true,
splitting: true,
outdir: 'dist',
format: 'esm',
loader: {
'.js': 'jsx',
},
inject: ['./preact-shim.js'],
jsxFactory: 'h',
jsxFragment: 'Fragment',
plugins: [
alias({
'react-dom': require.resolve('@preact/compat'),
react: require.resolve('@preact/compat'),
}),
stylePlugin({
postcss: {
plugins: [tailwindcssNesting, tailwindcss, autoprefixer],
},
cssModulesOptions: {
generateScopedName: '[hash:base64:5]',
},
}),
],
});