How can i add a simple, classic js script to the react project? I've tried to add it just by adding
<script src="../src/alert.js"></script>
in the head of the index.html but it seems not to work!
Here the Dan Abramov's answer say
Under the hood, Create React App uses Webpack with html-webpack-plugin.
The index.html is use as a template and the index.js is your entry point of you app
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
So if you want to load additional script you have to import them inside the index.js.
index.js->import './alert.js';index.htmlfile?