Combine local JavaScript files when you import applications

You can import Script Applications with multiple JavaScript files. JavaScript developers often minify and combine JavaScript files before you publish them. If you cannot or are not ready to combine your application JavaScript files before you push or import the application to your portal, you can use the following directive attribute to combine them at render time.

To proceed, you must ensure that the importer or push service can find a set of local script references that are siblings of each other. There must be nothing between them but white space.

Enabling the combiner

Choose one of the following options to enable combining of sibling local script references when the application is pushed or imported.

  • To enable resource combining for one application only, add a data-scriptportlet-combine-urls="true" directive attribute on the <html> element of the main page before you push or import the application to the server.
  • To enable resource combining for all pushed and imported applications, you can set the Script Application configuration property scriptportlet.import.combine.urls=true to true. For details about how to do this, read Setting custom configuration properties for the Script Application.