Editing JavaScript in Emprise UX

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:

  1. Open emprise-ux folder in your code editor, e.g. VS Code
  2. Open terminal within VS code and run npm install This will take a minute or two. Also, depending on your node/npm version, it may show warning but you can ignore that.
  3. Run npm run dev which will open the site in your chrome browser.
  4. 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.
  5. Edit the JS file and save. Ensure that you see the changes you made to code on your site on localhost.
  6. Save your changes and exit compiler by pressing CONTROL + X
  7. Run build by npm run build in your terminal.
  8. Once build is completed, your js changes will be compiled, minified and available in your main.js file within the html folder.

Thank you.