You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
687 B
JavaScript
28 lines
687 B
JavaScript
import * as esbuild from 'esbuild'
|
|
import { classModules, } from "esbuild-plugin-class-modules";
|
|
import tailwindcss from 'tailwindcss';
|
|
import autoprefixer from 'autoprefixer';
|
|
|
|
const config = {
|
|
entryPoints: ['src/index.tsx'],
|
|
bundle: true,
|
|
outdir: 'dist',
|
|
platform: 'browser',
|
|
format: 'esm',
|
|
external: ['fsevents'],
|
|
//plugins: [classModules({options:{postcss:[tailwindcss, autoprefixer]}})],
|
|
};
|
|
|
|
if(process.argv[2] === 'serve'){
|
|
const context = await esbuild.context(config);
|
|
|
|
const {host, port} = await context.serve({
|
|
servedir: 'dist',
|
|
host: '127.0.0.1'
|
|
});
|
|
|
|
console.log(`Listening on http://${host}:${port}/`);
|
|
}
|
|
else{
|
|
await esbuild.build(config);
|
|
} |