This is the home repository for:
- 📦
@collagejs/vite-im: Injects import maps and the@collagejs/imoNPM package into the project's root HTML page. It is used in root CollageJS projects. - 📦
@collagejs/vite-css: Injects a dynamic module capable of mounting and unmounting the bundled CSS files that Vite produces during its bundling process. It supports Vite's CSS splitting. It is used in all other CollageJS projects. - 📦
@collagejs/vite-aim: AIM stands for "autoexternalize import maps". This is a plug-in with server middleware that accepts the web page's import map and uses its contents to resolve bare module identifiers on the fly, allowing developers to import code from micro-frontend modules as if they were installed (like an NPM package). Requires@collagejs/imoin the project.
- Node.js >= 24.0.0
- npm >= 11.5.0
# Install all dependencies for the monorepo.
# Will build all packages as well.
npm install# Build all packages
npm run build
# Run tests across all packages
npm run test
# Lint all packages
npm run lint
# Type check all packages
npm run type-check
# Clean build artifacts
npm run cleanYou can also work on individual packages:
# Navigate to a specific package
cd packages/aim
# Install dependencies (if needed)
npm install
# Build this package only
npm run buildTo test your plugins in a Vite project, you can:
- Build the plugin:
npm run build - Link it locally:
npm link(in the plugin directory) - Use it in a test project:
npm link @collagejs/<package name>
⚠️ IMPORTANT: Linking withnpm linkcan only handle one linked package at a time. The others must be built and installed either from an online repository or a NPM package file, which can be created withnpm pack.
To add a new plugin to this monorepo:
- Create a new directory in
packages/ - Update the package name and description
- Add a
tsconfig.jsonfile similar or identical to one from another plug-in - Add the new package to the TypeScript project references in the root
tsconfig.json - Implement the plugin logic
- TypeScript: Shared configuration in
tsconfig.base.json - ESLint: Root configuration in
.eslintrc.js - Prettier: Root configuration in
.prettierrc.json
MIT - see individual package.json files for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Run
npm run lintandnpm run type-check - Submit a pull request