-
Notifications
You must be signed in to change notification settings - Fork 792
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
Import from index files doesn't work #235
Comments
Could you provide me with your tsconfig.json file contents? I want to make sure that you have |
I am using the config that is in I updated it to include {
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"allowJs": true,
"declaration": false,
"experimentalDecorators": true,
"lib": [
"dom",
"es2015"
],
"moduleResolution": "node",
"module": "es2015",
"target": "es2015",
"noUnusedLocals": true,
"noUnusedParameters": true,
"jsx": "react",
"jsxFactory": "h"
},
"include": [
"src"
],
"exclude": [
"node_modules"
]
} My code includes an import from
If I change my code to import from |
Ya this looks like a bug to me. I think it might be a setup issue with Rollup. I will research further. |
Rollup does not resolve index files from paths. It appears that we need to add a rollup plugin to allow for this. https://github.com/frostney/rollup-plugin-local-resolve Or use the app-scripts code. |
Stencil version:
I'm submitting a ...
[x] bug report
Current behavior:
Unable to resolve references to index.js files.
Expected behavior:
It should be possible to import from index files.
Steps to reproduce:
If the project has a directory of shared utilities in
/src/util/
.src/util
.nom start
This results in the following error:
If you use
Import { MyUtil } from '../util/index';
then you do not get the error.A similar error occurs if any downstream references use index files. For example, if
my-util.ts
includes a reference to another class via a directory index.TypeScript compilation works fine. It is the Stencil process that gets the error.
The text was updated successfully, but these errors were encountered: