-
Notifications
You must be signed in to change notification settings - Fork 70
Closed
Labels
kind: bugSomething isn't working properlySomething isn't working properlypriority: blockedProgress on this is blockedProgress on this is blockedproblem: staleIssue has not been responded to in some timeIssue has not been responded to in some timescope: upstreamIssue in upstream dependencyIssue in upstream dependencysolution: workaround availableThere is a workaround available for this issueThere is a workaround available for this issuetopic: OS separatorsPath normalization between OSes. Windows = '\', POSIX = '/'. Rollup resolve = native, TS = POSIXPath normalization between OSes. Windows = '\', POSIX = '/'. Rollup resolve = native, TS = POSIX
Description
What happens and why it is wrong
Briefly:
Code splitting is not supported now
Versions
- typescript: 3.5.3
- rollup: 1.20.3
- rollup-plugin-typescript2: 0.24.0
rollup.config.js
import resolve from 'rollup-plugin-node-resolve';
import ts2 from 'rollup-plugin-typescript2';
export default {
// NOTE: object here
input: {
'my-lib': 'src/main.ts',
'my-tools': 'src/tools.ts'
},
output: {
dir: 'dist',
format: 'esm'
},
plugins: [
resolve(),
ts2()
]
};
tsconfig.json
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"sourceMap": true,
"importHelpers": true,
"downlevelIteration": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"lib": ["esnext"],
"types": ["node"]
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
}
files
src/tools.ts
export function myFn() {
console.log('Hello World!');
}
src/main.ts
import { myFn } from './tools';
console.log(myFn());
plugin output
dist/my-tools.js OK
function myFn() {
console.log('Hello World!');
}
export { myFn };
dist/my-lib.js WRONG
function myFn() {
console.log('Hello World!');
}
console.log(myFn());
expected output
dist/my-lib.js
import { myFn } from './my-tools.js';
console.log(myFn());
agilgur5
Metadata
Metadata
Assignees
Labels
kind: bugSomething isn't working properlySomething isn't working properlypriority: blockedProgress on this is blockedProgress on this is blockedproblem: staleIssue has not been responded to in some timeIssue has not been responded to in some timescope: upstreamIssue in upstream dependencyIssue in upstream dependencysolution: workaround availableThere is a workaround available for this issueThere is a workaround available for this issuetopic: OS separatorsPath normalization between OSes. Windows = '\', POSIX = '/'. Rollup resolve = native, TS = POSIXPath normalization between OSes. Windows = '\', POSIX = '/'. Rollup resolve = native, TS = POSIX