- Rollup Version: 1.20.3
- Operating System (or Browser): Windows
- Node Version: v8.11.1
How Do We Reproduce?
Unpack attached example code, run npm install, run
.\node_modules\.bin\rollup -c .\rollup.config.js
See also: ezolenko/rollup-plugin-typescript2#169
Expected Behavior
my-lib.js bundle should look like this:
import { myFn } from './my-tools.js';
console.log(myFn());
Actual Behavior
Contents of my-tools.js gets bundled in.
Reason
Rollup seems to be using resolved import paths as keys without normalizing them, rollup-plugin-typescript2 uses typescript's resolver and returns POXIS path, whatever rollup uses returns Windows paths, so strings are different.
There is an option for rollup-plugin-typescript2 (rollupCommonJSResolveHack: true) to run resolved import through resolve() to get native OS path before returning it to rollup, using that produces correct bundles.
Ideally rollup should just normalize import paths somewhere.
How Do We Reproduce?
Unpack attached example code, run npm install, run
.\node_modules\.bin\rollup -c .\rollup.config.jsSee also: ezolenko/rollup-plugin-typescript2#169
Expected Behavior
my-lib.jsbundle should look like this:Actual Behavior
Contents of
my-tools.jsgets bundled in.Reason
Rollup seems to be using resolved import paths as keys without normalizing them,
rollup-plugin-typescript2uses typescript's resolver and returns POXIS path, whatever rollup uses returns Windows paths, so strings are different.There is an option for
rollup-plugin-typescript2(rollupCommonJSResolveHack: true) to run resolved import throughresolve()to get native OS path before returning it to rollup, using that produces correct bundles.Ideally rollup should just normalize import paths somewhere.