bundle yjs as a module to prevent declaration issues from circular dependencies
This commit is contained in:
parent
76c389dba0
commit
62888b4004
@ -3,7 +3,7 @@
|
||||
"version": "13.0.2",
|
||||
"description": "Shared Editing Library",
|
||||
"main": "./dist/yjs.cjs",
|
||||
"module": "./src/index.js",
|
||||
"module": "./dist/yjs.mjs",
|
||||
"types": "./dist/src/index.d.ts",
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
|
@ -51,6 +51,21 @@ export default [{
|
||||
}
|
||||
},
|
||||
external: id => /^lib0\//.test(id)
|
||||
}, {
|
||||
input: './src/index.js',
|
||||
output: {
|
||||
name: 'Y',
|
||||
file: 'dist/yjs.mjs',
|
||||
format: 'esm',
|
||||
sourcemap: true,
|
||||
paths: path => {
|
||||
if (/^lib0\//.test(path)) {
|
||||
return `lib0/dist/${path.slice(5, -3)}.cjs`
|
||||
}
|
||||
return path
|
||||
}
|
||||
},
|
||||
external: id => /^lib0\//.test(id)
|
||||
}, {
|
||||
input: './tests/index.js',
|
||||
output: {
|
||||
|
@ -56,5 +56,6 @@ export {
|
||||
isParentOf,
|
||||
equalSnapshots,
|
||||
PermanentUserData, // @TODO experimental
|
||||
tryGc
|
||||
tryGc,
|
||||
transact
|
||||
} from './internals.js'
|
||||
|
@ -338,7 +338,6 @@ const cleanupTransactions = (transactionCleanups, i) => {
|
||||
* @param {function(Transaction):void} f
|
||||
* @param {any} [origin=true]
|
||||
*
|
||||
* @private
|
||||
* @function
|
||||
*/
|
||||
export const transact = (doc, f, origin = null, local = true) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user