-
Notifications
You must be signed in to change notification settings - Fork 925
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
when importing a component, symlink points to source when specifying different dist target #1648
Comments
Actually, the link in However, I do see another issue here. @odedre , changing the extension of the |
… the components dir to point to the dist file with the dist extension
@davidfirst In order for this to work I needed to change both the |
@odedre , can you describe the issue you're having? Did you run something and got an error? if so, how do I reproduce it? |
@davidfirst , there seem to be a set of issues when trying to use create-react-app with imported bit-typescript components. All issues @odedre opened during the last couple of days were specific edge cases he encountered. I think that we should handle all of them when setting a demo CRA project that imports a TS component. Once we have a base project to use, and we get CRA's compilation errors - we can resolve the issues one-by-one, without the need to constantly open small bugs. |
It's fixed and merged into master. |
@davidfirst I'm not sure this is enough to fix the problem. |
@GiladShoham , I tested it by requiring the component using module path and it's working. |
@odedre I saw that the symlink points to the correct place (dist) after import. I'm wondering what should be the value in the root's package.json. The source path or dist path. |
I had this problem and solved it by doing Thanks @ GiladShoham :) |
Description
I specified different source and dist target and then imported a component.
when specifying a different dist target, the sym link in the
package.json
points to the source folder, not the dist.I'm using a create react app.
source code should go in
/components
and dist inbit-dist
├── README.md
├── components
│ └── imdb-api
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ │ ├── imdb.ts
│ │ └── interfaces.ts
├── package-lock.json
├── package.json
├── src
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── bit-dist
│ │ └── imdb-api
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── imdb.js
│ │ │ ├── imdb.js.map
│ │ │ ├── interfaces.js
│ │ │ └── interfaces.js.map
package.json:
Expected Behavior
the link in
package.json
should point to the dist targetActual Behavior
the link in
package.json
should point to the source targetSteps to Reproduce the Problem
"dist": {
"entry": "components",
"target": "src/bit-dist"
}
4.bit import open-apis.apis/imdb-api
5. import the component to
app.js
(e.g.import imdb from '@bit/open-apis.apis.imdb-api'
)6. package.json link points to
/components
.*at this point you should see the following error:
Specifications
The text was updated successfully, but these errors were encountered: