-
-
Notifications
You must be signed in to change notification settings - Fork 54
Closed
Labels
🐞 bugSomething isn't workingSomething isn't working
Description
Version
System:
OS: macOS 14.6.1
CPU: (12) arm64 Apple M2 Max
Memory: 14.12 GB / 96.00 GB
Shell: 3.7.1 - /opt/homebrew/bin/fish
Browsers:
Chrome: 130.0.6723.117
Safari: 17.6
npmPackages:
@rslib/core: ^0.0.18 => 0.0.18Details
I'm building an library using Rslib with multiple entries:
import { defineConfig } from '@rslib/core';
export default defineConfig({
lib: [
{
format: 'esm',
syntax: 'es2021',
},
],
source: {
entry: {
index: './src/index.ts',
foo: './src/foo.ts',
},
},
});And index is using foo as dependencies:
// index.js
import { foo } from './foo.js'
console.log(foo)But this results in get an empty module ./src/foo.ts in dist/index.js:
// dist/index.js
var __webpack_modules__ = {
"./src/foo.ts": function() {}
};which would cause error at runtime.
Reproduce link
https://github.com/colinaaa-reproductions/rslib-repro-multi-entries
Reproduce Steps
pnpm installpnpm buildnode dist/index.js
An error occurs:
console.log((0, foo.foo)());
^
TypeError: (0 , foo.foo) is not a function
at /root/dist/index.js:22:25
at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)
Metadata
Metadata
Assignees
Labels
🐞 bugSomething isn't workingSomething isn't working