[Chartjs]-React without npm – is it possible to import libraries / modules?

1πŸ‘

Ok so this is a HORRIBLE hack using PHP but it’s the only option I found. I too do not have a server with npm available. So, instead of using javascript import, or package managers, like browserify, which DO NOT work as they still require npm, I use PHP to create a single large contents of from multiple files:

<script type="text/babel">

<?php

include 'BDRMLElement.js';

?>

...

class App extends React.Component {
 ...
 render() {
   return (
        <div>
          <BDRMLElement />
...

</script>

Leave a comment