An esbuild plugin to handle toml files.
npm install esbuild-plugin-toml -D
yarn add esbuild-plugin-toml -D
esbuild.config.json
const esbuild = require('esbuild');
const toml = require('esbuild-plugin-toml');
esbuild.build({
bundle: true,
entryPoints: ['main.js'],
outfile: 'out.js',
plugins: [
toml()
]
}).catch(() => process.exit(1))
In your JS files:
const tomlObject = require('example.toml');