Libundler
š¦ Universal JavaScript library bundler, powered by @rollup.
Install / Use
/learn @surmon-china/LibundlerREADME
libundler
š¦ Universal JavaScript library bundler, powered by Rollup.
Usage
1. install
npm install @surmon-china/libundler --save-dev
You can also use yarn or pnpm.
2. add build script to package.json
"scripts": {
"build": "libundler"
}
You can also use the command b.
3. run build
yarn build
Config
By default, you do not need to specify configuration file, libundler will generate a nearly perfect configuration for the bundle according to your package.json.
But if you have more specific needs, you can create libundler.config.js or libundler.config.ts in your project root.
LibundlerConfigObjectLibundlerConfigObject[](defaultRollupConfig) => RollupConfig
config example projects:
- javascript nope config
- javascript
cjsformat config - javascript
esmformat config - typescript
- react-jsx-scss
- react-tsx
object config example:
// libundler.config.js
/** @type {import('@surmon-china/libundler/lib/interface').LibundlerConfigObject} */
module.exports = {
entry: 'src/index.js',
// ...
}
array config example:
// libundler.config.js
/** @type {import('@surmon-china/libundler/lib/interface').LibundlerConfigArray} */
module.exports = [
{
entry: 'src/index.ts',
// ...
},
{
entry: 'src/entry.ts',
// ...
},
]
function config example:
// libundler.config.js
/** @type {import('@surmon-china/libundler/lib/interface').LibundlerConfigFn} */
module.exports = (rollupConfig) => {
// overwrite the Rollup config
rollupConfig.plugins.push(/* ... */)
// ...
return rollupConfig
}
esm config example:
// libundler.config.js
export default {
entry: 'src/index.js',
// ...
}
.ts config example:
// libundler.config.ts
import { defineConfig } from '@surmon-china/libundler'
export default defineConfig({
entry: 'src/index.js',
// ...
})
JavaScript API
const libundler = require('@surmon-china/libundler')
libundler
.bundle({
/* LibundlerConfig */
})
.then((result) => {
console.log('bundle success', result)
})
.catch((error) => {
console.log('bundle error', error)
})
Development
yarn dev
yarn lint
yarn build
yarn release
Changelog
Detailed changes for each release are documented in the release notes.
License
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Writing Hookify Rules
96.8kThis skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
review-duplication
99.8kUse this skill during code reviews to proactively investigate the codebase for duplicated functionality, reinvented wheels, or failure to reuse existing project best practices and shared utilities.
