I setup esbuild with a sinatra app and I'm trying to bundle my CSS using the esbuild.config.js below. The problem is the css file is being output as .js. What am I doing wrong here?
import * as esbuild from 'esbuild';
import {sassPlugin} from 'esbuild-sass-plugin';
import * as path from 'path';
await esbuild.build({
entryPoints: ["./assets/javascripts/application.js",
"./assets/stylesheets/application.css"],
bundle: true,
outdir: "./public",
absWorkingDir: path.join(process.cwd()),
watch: true,
// custom plugins will be inserted is this array
plugins: [sassPlugin({
type: 'stylesheet'
})],
}).catch(() => process.exit(1));
Here is the output:
public/stylesheets/application.js
(() => {
// assets/stylesheets/application.css
var application_default = `
p {
color: red;
text-align: center;
font-size: 24px;
}`;
})();