Open tdeekens opened 2 years ago
I believe this library bundles all it's dependencies.
Thanks for the quick response. The error I am receiving looks as follows
> preconstruct build
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'is-mergeable-object'
Require stack:
- /<path>/flopflip/node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/index.js
- /<path>/flopflip/node_modules/.pnpm/@rollup+plugin-node-resolve@9.0.0_rollup@2.70.0/node_modules/@rollup/plugin-node-resolve/dist/cjs/index.js
- /<path>/flopflip/node_modules/.pnpm/@preconstruct+cli@2.1.5/node_modules/@preconstruct/cli/cli/dist/cli.cjs.dev.js
- /<path>/flopflip/node_modules/.pnpm/@preconstruct+cli@2.1.5/node_modules/@preconstruct/cli/cli/dist/cli.cjs.js
- /<path>/flopflip/node_modules/.pnpm/@preconstruct+cli@2.1.5/node_modules/@preconstruct/cli/bin.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (/<path>/flopflip/node_modules/.pnpm/v8-compile-cache@2.3.0/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at Object.<anonymous> (/<path>/flopflip/node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/index.js:1:94)
at Module._compile (/<path>/flopflip/node_modules/.pnpm/v8-compile-cache@2.3.0/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/<path>/flopflip/node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/index.js',
'/<path>/flopflip/node_modules/.pnpm/@rollup+plugin-node-resolve@9.0.0_rollup@2.70.0/node_modules/@rollup/plugin-node-resolve/dist/cjs/index.js',
'/<path>/flopflip/node_modules/.pnpm/@preconstruct+cli@2.1.5/node_modules/@preconstruct/cli/cli/dist/cli.cjs.dev.js',
'/<path>/flopflip/node_modules/.pnpm/@preconstruct+cli@2.1.5/node_modules/@preconstruct/cli/cli/dist/cli.cjs.js',
'/<path>/flopflip/node_modules/.pnpm/@preconstruct+cli@2.1.5/node_modules/@preconstruct/cli/bin.js'
]
}
If you need a quick fix, I'd recommend deepmerge-ts
Ok. I moved over the merge-deep
which works for me.
I confirm this issue(?)
to solve: (one of)
index.d.ts
to public.d.ts
(or any other), and set "types": "./public.d.ts"
in package.json
index.js
to .npmignore
Why:
deepmerge
in deepmerge/index.d.ts
import deepmerge from 'deepmerge/index';
when "types" in package.json, TSLS will know "the package named deepmerge provides symbol deepmerge"
Erh yeah is-mergeable-object most definitely should be a depedency, not a devDependency... https://github.com/TehShrike/deepmerge/blob/master/index.js#L1
https://github.com/TehShrike/deepmerge/blob/master/index.js#L78
This generated a faulty bundle when building with Rollup.
Relevant logs:
(!) Missing global variable name
https://rollupjs.org/configuration-options/#output-globals
Use "output.globals" to specify browser global variable names corresponding to external modules:
is-mergeable-object (guessing "require$$0")
fixable by installing is-mergeable-object
, but would have already been installed if included in package.json
's dependencies
(and not devDependencies
)
When using
pnpm
and building usingpreconstruct
I stumbled across noticing thatis-mergeable-object
is adevDep
in this project while it's being used also in theindex.js
.Should it be promoted to be a regular dependency?