esbuild-plugin-postcss-literal
PostCSS tagged template literals plugin for esbuild.
Install
npm install esbuild-plugin-postcss-literal --save-dev
Use
esbuild.config.json
import esbuild from 'esbuild';
import postcssLiteral from 'esbuild-plugin-postcss-literal';
esbuild
.build({
entryPoints: ['index.js'],
bundle: true,
outfile: 'main.js',
plugins: [postcssLiteral()]
})
.catch(() => process.exit(1));
package.json
{
"type": "module",
"scripts": {
"start": "node esbuild.config.js"
}
}
Configure
esbuild.config.json
postcssLiteral({
filter: /.*/,
namespace: '',
tag: 'css',
minify: false,
config: {}
});
.postcssrc
{
"plugins": {
"postcss-plugin": {}
}
}
Check
esbuild-plugin-merge → Pipe esbuild plugins output.
esbuild-plugin-babel → Babel plugin for esbuild.