-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Imported helper support requires "moduleResolution": "node"
in tsconfig
#14
Comments
Any solutions for this one ? My build with rollup works, but then when I am using my lib in node projects i get this error: |
That shouldn't happen... Did you set tslib as an external dependency in rollup config? What's you rollup / typescript versions and what does top of your transpiled bundle look like? Does it have import/require tslib? |
I have Versions: "rollup": "^0.43.0",
"tslib": "^1.7.1",
"tslint": "^5.4.3",
"typescript": "^2.4.1" and my config is: {
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"rootDir": "src",
"outDir": ".code",
"newLine": "LF",
"lib": [
"es2015",
"es2016",
"es2017",
"dom",
"scripthost"
],
"moduleResolution": "node",
"importHelpers": true,
"declaration": true,
"pretty": true,
"sourceMap": true,
"inlineSources": true,
"noUnusedLocals": true,
"skipLibCheck": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"**/*.spec.ts",
"dist",
"es",
"lib"
]
} |
What your rollup config look like? Also, try with |
moduleName: pascalCase(pkg.name),
entry: "src/index.ts",
dest: "dist/bundle.js",
format: "umd",
exports: "named",
sourceMap: true,
plugins: [
typescript(),
sourcemaps(),
resolve({
jsnext: true,
browser: true
}),
commonjs(),
globals(),
builtins(),
uglify()
] |
Could you run the build with Also post your package config (the part with all the rollup plugins). It is possible one of those plugins clobbers tslib resolution and it doesn't get replaced by this plugin... |
With the master branch it does work. Could you release it ? |
Cool, I'll release later today. |
Back to original bug, reading typescript documentation it seems |
"moduleResolution": "node"
in tsconfig
Otherwise typescript can't find
tslib
in localnode_modules
. (see #12)Running
tsc
without that option works, so there must be a better way of finding tslib than usingrequire.resolve
.The text was updated successfully, but these errors were encountered: