refactor: use Tailwind CLI and esbuild for assets
Fixes: #10 Fixes: #14
This commit is contained in:
parent
aa22925e92
commit
6e120bee3a
15 changed files with 1381 additions and 9904 deletions
28
esbuild.config.js
Normal file
28
esbuild.config.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
const esbuild = require('esbuild')
|
||||
|
||||
let minify = false
|
||||
let sourcemap = true
|
||||
let watch_fs = true
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
minify = true
|
||||
sourcemap = false
|
||||
watch_fs = false
|
||||
}
|
||||
|
||||
const watch = watch_fs && {
|
||||
onRebuild(error) {
|
||||
if (error) console.error('[watch] build failed', error)
|
||||
else console.log('[watch] build finished')
|
||||
},
|
||||
}
|
||||
|
||||
esbuild.build({
|
||||
entryPoints: ['./assets/js/app.js'],
|
||||
outfile: './build/app.js',
|
||||
bundle: true,
|
||||
minify: minify,
|
||||
sourcemap: sourcemap,
|
||||
watch: watch,
|
||||
plugins: [],
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue