react-pivottable icon indicating copy to clipboard operation
react-pivottable copied to clipboard

I can't deploy the react component on apache server

Open jakub0225 opened this issue 8 years ago • 5 comments

Thanks for your attention!

I tried to deploy the react-pivottable component on apache server. I installed the apache server and executed the react-pivottable app in my computer. Now I should deploy it on the apache server. So I tried to build the component to js file, but it doesn't work. I have executed the following commands on the react-pivottable app.

$npm install #this is working $npm start #this is working $npm run build #this is not working $npm run production #this is not working

My aim is to convert the component to general javascript file so that it is used to display some data on apache server. I must use just the react component. Please help me.

jakub0225 avatar Nov 27 '17 20:11 jakub0225

I'm not sure that this package does exactly what you're looking for but I'm happy to help you try to get there! This is a component which is meant to be used within a compiled and bundled app, not a standalone app, which is why you can't just deploy it by itself.

The commands that you can run via NPM are defined in package.json and there you can see that build and production not defined, which is why those commands aren't working. npm start runs a Webpack dev server that spins up the demo app in /examples. If you run webpack -p, this will output bundle.js which is the compiled Javascript for the demo app, without running the demo server.

This is likely not what you want, though... to use this component you will probably want to create your own app, with its own webpack.config.js file and bundling mechanism, and within that app all you'll need to do is run the npm install command to add this component to your dependencies so you can use it as you like.

I should add that there is also no mechanism at the moment to compile this component to a Javascript file which can be included via a single <script> tag, in case that's what you're trying to do...

If you give me a bit more context about how you'd like to use this component, I should be able to help you further!

nicolaskruchten avatar Nov 28 '17 14:11 nicolaskruchten

Thanks.

I have read your explanation and I got helped a lot. I will ask you for the problems using the pivot table later.

And I have another question, can I display the detail data over the bars when I use the bar chart to show some data? I will be glad to help me in this case. I prefer the detail method to realize it.

capture3

Regards!

jakub0225 avatar Dec 01 '17 12:12 jakub0225

I'm not sure that's possible at the moment but I'll try to figure out a way to enable it :)

nicolaskruchten avatar Dec 01 '17 14:12 nicolaskruchten

Thank you for your kindness.

jakub0225 avatar Dec 01 '17 16:12 jakub0225

I ran into a similar issue. Wanted to make this a run into production & could not crack how to make a build. So this is what I did.

  • Added webpack to build in package.json "scripts": { ... "build": "webpack", ... }

  • Did a "npm run build" command in the project directory

  • bundle.js was generated. Copied this & placed it in examples folder.

  • Now deployed just the example folder. It's standalone build for the app. There are other ways as well. But this worked for me.

pankajkumar48 avatar Apr 14 '19 17:04 pankajkumar48