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
Support for a Working NPM Package #22
Comments
I think the NPM package has changed. |
@morloy thanks for clarifying. That is helpful to know the latest version is deployed to NPM, but the core problem remains. The project is still not easily imported as a dependency into an existing project. |
@marrobins do you have a working configuration for this that you could maybe share? I'm having some trouble getting this to work in webpack encore. |
@webbertakken no, we ended up moving away from Core UI because of this issue. |
@webbertakken please take a look at https://github.com/mrholek/CoreUI-React/tree/v2.0.0 - it is a work in progress but shows direction we are heading. |
This worked for my project:
And then:
and
Is working great for me so far.. |
@marrobins I'm having the exact same issue with this. What did you decide on using instead? |
I got it to work too. It's still a ton of work to figure out all the things that didn't work out of the box, especially if you want run the I ended up making quite a few changes in 10 files together, so i won't copy paste them here. If anyone needs some help or has any specific questions i might be able to help out. |
hey @marrobins @webbertakken I want to integrate this with one of my existing react application.I am having trouble in figuring out a workflow to do so.Can any one help me out here ? |
@vpn1997 ivesdebruycker gave an answer that should get you halfway there. could you be more specific about what you're trying to do? And what have you got now? |
@webbertakken @marrobins Hey I tried to import P.s This happens with every component that I import . |
@vpn1997 Looks like a big part is working already. At least you got it to compile. I think your styles aren't loaded. Probably you're missing a style tag in your markup. You should include the styles so it comes along during transpiring with babel. When it enters your build folder you still have to reference it in your markup. Also make sure it resides in a public folder. Also make sure you have version 2.x.x of the package not the 1.x.x version. It would be nice if you addressed the community rather than me personally next time :) |
I am not using the coreui npm package rather I have cloned coreui repo(inside my react app) from which I Import all the components. CoreUi npm package was not working for me .(https://www.npmjs.com/package/@coreui/react) . |
|
@vpn1997 I had a similar error which I solved by updating my react to 16.4.1 |
The React CoreUI.io project is built as scaffolding to start a new app (not as an importable React component library that you can add to an existing project). There will likely be high-value changes made to the CoreUI project in the future that others want to incorporate (e.g bug fixes and support for Twitter Bootstrap 4 final release), so we don't want to use CoreUI.io as merely scaffolding, as this will make upgrades fragile and time consuming.
Ideally, we would use CoreUI as any other JavaScript dependency and install it via NPM as this makes upgrades to new versions more straight-forward and predictable. There is an official version of CoreUI deployed to NPM that can be added as a dependency to an existing project, but there are problems with the official NPM package:
prepublish
lifecycle script defined to compile components).This rules out using the official NPM package, so we need a way to easily convert the most recent version from Github into a working NPM package that we can add as a dependency to our project. This requires the following steps:
prepublish
lifecycle script to package.jsonThis is not very convenient. Is support for a working NPM package on the horizon? If not, would you consider a pull-request that achieves this?
The text was updated successfully, but these errors were encountered: