mirror of
https://github.com/loro-dev/loro.git
synced 2025-01-22 21:07:43 +00:00
62a3a93552
* feat: make vitest tests pass * chore: update readme & add deno test for web bundle * chore: bump version to 1.0.8-alpha.0 * chore: bump loro-crdt version * fix: build script export init method from loro-wasm/web * chore: bump version * chore: specify which files to include for npm publish * refactor: rename loro-js to loro-js-test * refactor: remove the old loro-js folder * fix: build scripts * chore: 1.0.8-alpha.3 * chore: add release info
38 lines
842 B
JavaScript
38 lines
842 B
JavaScript
import typescript from '@rollup/plugin-typescript';
|
|
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
const createConfig = (format, tsTarget, outputDir) => ({
|
|
input: {
|
|
'index': 'index.ts',
|
|
},
|
|
output: {
|
|
dir: outputDir,
|
|
format: format,
|
|
sourcemap: true,
|
|
entryFileNames: '[name].js',
|
|
},
|
|
plugins: [
|
|
typescript({
|
|
tsconfig: 'tsconfig.json',
|
|
compilerOptions: {
|
|
target: tsTarget,
|
|
declaration: true,
|
|
outDir: outputDir,
|
|
},
|
|
exclude: ['tests/**/*']
|
|
}),
|
|
nodeResolve()
|
|
],
|
|
external: [/loro_wasm/]
|
|
});
|
|
|
|
// Create different bundle configurations
|
|
export default [
|
|
// CommonJS for Node.js
|
|
createConfig('cjs', 'ES2020', 'nodejs'),
|
|
|
|
// ESM for Web
|
|
createConfig('es', 'ES2020', 'web'),
|
|
|
|
// ESM for bundler
|
|
createConfig('es', 'ES2020', 'bundler'),
|
|
];
|