diff --git a/package.json b/package.json index 4beb88f2..24de0a4e 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "yjs", + "name": "yjs-amd", "version": "13.6.20", "description": "Shared Editing Library", - "main": "./dist/yjs.cjs", + "main": "./dist/yjs.amd.js", "module": "./dist/yjs.mjs", "types": "./dist/src/index.d.ts", "type": "module", @@ -57,7 +57,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/yjs/yjs.git" + "url": "https://github.com/monogramdesign/yjs.git" }, "keywords": [ "Yjs", @@ -96,4 +96,4 @@ "npm": ">=8.0.0", "node": ">=16.0.0" } -} +} \ No newline at end of file diff --git a/rollup.config.js b/rollup.config.js index 61afb735..eb134961 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -103,4 +103,20 @@ export default [{ commonjs() ], external: id => /^lib0\//.test(id) -}] +}, { + input: './src/index.js', + output: { + name: 'Y', + file: 'dist/yjs.amd.js', + format: 'amd', + sourcemap: true + }, + plugins: [ + nodeResolve({ + browser: true, // Use browser-compatible versions of modules + extensions: ['.js', '.ts'], + preferBuiltins: false // Do not prefer Node.js built-ins + }), + commonjs() + ] +}] \ No newline at end of file