1
votes

I am working on a project under CMS, I do not have any access to server.

so I downloaded below 4 files

browser.min.js
jquery.min.js
react.js
react-dom.js
remarkable.min.js

and loaded on the html page. Everything works fine before I use import.

import { sample } from './sample';

Makes Uncaught ReferenceError: require is not defined on React

I am not able to install weback or Browserify on the server, so have to load from somewhere.

Anyone has got a solution for this?

1
You've got to give more context, such as your configuration. If you want to use ES6 syntax you'll need to transpile it to ES5. Also, you need a module library for require. - Andrew Li
😱 You don't know npm !! - Abdennour TOUMI
I cannot access to server so cannot use npm... - Lee

1 Answers

0
votes

This might be what you're looking for.

<head>
 <script 
 src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.3/react.min.js">
 </script>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.3/react-
  dom.min.js"></script>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-
  core/5.8.23/browser.min.js"></script>
</head>