documentationfor yFiles for HTML 2.5

Preparing a Redistributable Library

The development mode library of yFiles for HTML is not redistributable as-is. To deploy your project for production, you can either

  • replace the development mode library with the redistributable library from the lib folder of the yFiles for HTML package, or
  • convert the development mode library into the redistributable library with a build tool like webpack that removes the development information.

With webpack, just set the "mode" configuration option to "production". Popular JavaScript toolkits like Angular CLI, Vue CLI and Create React App use webpack under the hood. Therefore, the production build results of one of these frameworks will be properly prepared for production environments without additional effort.

Technical Details

The development mode library can be switched into production mode by setting the value of process.env.NODE_ENV to production. When a build tool is used that supports tree shaking as well as replacing node environment variable references at compile time, the yFiles debugging information will be stripped from the development library. A yFiles for HTML library processed this way can be released to your production environment.

For testing the yFiles library in production mode without running a production build, you can of course also enable it manually by including this simple snippet in your HTML file before loading yFiles:

<script>
  window.process = { env: { NODE_ENV: 'production' } }
</script>