Home

tailwind-ctp-intellisense @3df69994c48b5b8df5fc06d24e43dccd716f9659 - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tailwind-ctp-intellisense / packages / tailwindcss-language-service / scripts / build.mjs
- raw
 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
import path from 'node:path'
import { spawnSync } from 'node:child_process'
import esbuild from 'esbuild'
import minimist from 'minimist'
import { nodeExternalsPlugin } from 'esbuild-node-externals'

const __dirname = new URL('.', import.meta.url).pathname

const args = minimist(process.argv.slice(2), {
  boolean: ['watch', 'minify'],
})

console.log('- Preparing')
let build = await esbuild.context({
  entryPoints: [path.resolve(__dirname, '../src/index.ts')],
  bundle: true,
  platform: 'node',
  external: [],
  outdir: 'dist',
  minify: args.minify,

  format: 'esm',

  plugins: [
    nodeExternalsPlugin(),
    {
      name: 'generate-types',
      async setup(build) {
        build.onEnd(async (result) => {
          // Call the tsc command to generate the types
          spawnSync(
            'tsc',
            ['--emitDeclarationOnly', '--outDir', path.resolve(__dirname, '../dist')],
            {
              stdio: 'inherit',
            }
          )
        })
      },
    },
  ],
})

console.log('- Building')
await build.rebuild()

if (args.watch) {
  console.log('- Watching')
  await build.watch()
} else {
  console.log('- Cleaning up')
  await build.dispose()
}