Emprise uses vanilla JS and no jQuery. Unlike HTML or CSS the Vanilla JS needs to be parsed and compiled. Therefore, to edit the JS files, you should use JS compiler like babel. We have included everything you need for this in the package. Here are the steps:
- Open emprise-ux folder in your code editor, e.g. VS Code
- Open terminal within VS code and run
npm installThis will take a minute or two. Also, depending on your node/npm version, it may show warning but you can ignore that.
npm run devwhich will open the site in your chrome browser.
- Go to the src > components folder and open the component that you want to edit. If the component has a JS file, you will find it within the component folder.
- Edit the JS file and save. Ensure that you see the changes you made to code on your site on localhost.
- Save your changes and exit compiler by pressing CONTROL + X
- Run build by
npm run buildin your terminal.
- Once build is completed, your js changes will be compiled, minified and available in your main.js file within the html folder.