M
M
Maks Burkov2017-05-19 00:00:34
Node.js
Maks Burkov, 2017-05-19 00:00:34

How to export modules correctly?

Need help setting up the project .. It seems that all the dependencies are there, why require is not defined ?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ReactApp</title>
    <link rel="stylesheet" href="../bower_components/font-awesome/css/font-awesome.css">
    <link rel="stylesheet" href="../css/index.css">
    <script src="../bower_components/react/react.js"></script>
    <script src="../bower_components/react/react-dom.js"></script>
    <script src="../bower_components/jquery/dist/jquery.js"></script>
    <script src="../bower_components/express/lib/express.js"></script>
    <script src="../bower_components/babel/browser.js"></script>
    <script src="../bower_components/component/component.js"></script>
</head>
<body>
    <div id="app"></div>
    <script type="text/babel" src="../js/app.jsx">

    </script>
    <script src="../js/index.js"></script>
    <script src="../js/server.js"></script>
</body>
</html>

Why is element not exported?
958aeeb963d14a63a654d243e8cecef2.png
Errors:
1dddf577cde04a66924dac1b19e59a0d.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim, 2017-05-19
@maxfarseer

Apparently, it is necessary to transfer the babel connections to the first place, then the rest of the scripts.

K
KnightForce, 2017-05-19
@KnightForce

And if you take out the common code in a separate file, then first it, then babel, and then everything else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question