@lsagetlethias/airtable-blocks-vite-bundler
v0.0.4
Published
Vite bundler for @airtable/blocks-cli
Readme
@lsagetlethias/airtable-blocks-vite-bundler
airtable-blocks-vite-bundler is a small TypeScript library that provides a programmatic wrapper around Vite (v7) for building Airtable Blocks and similar third-party blocks.
See https://github.com/Airtable/blocks.
Installation
Use the package manager npm or yarn (or whatever) to install the package:
npm install --save-dev @lsagetlethias/airtable-blocks-vite-bundler
# or
yarn add --dev @lsagetlethias/airtable-blocks-vite-bundlerUsage
- Create a file named
bundler.jsinside your app project folder with the following contents:
const createBundler = require('@lsagetlethias/airtable-blocks-vite-bundler').default;
function createConfig(baseConfig) {
// Add any desired customizations here
return baseConfig;
}
exports.default = () => {
return createBundler(createConfig);
};- Inside your
block.jsonfile, add a "bundler" field, with a "module" field inside that points to your bundler file.
{
"version": "1.0",
- "frontendEntry": "./frontend/index.js"
+ "frontendEntry": "./frontend/index.js",
+ "bundler": {
+ "module": "./bundler.js"
+ }
}Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update or add tests as appropriate.
