Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-11960

Use NPM with gradle to get external JS dependencies

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Trivial
    • Resolution: Implemented
    • Trunk, Upcoming Branch
    • Upcoming Branch
    • ALL APPLICATIONS
    • None
    • OFBiz Community Day (Aug 2020)

    Description

      As discussed here, use gradle-js-plugin to ease out managing the JavaScript dependencies. The Gradle plugin allows us to automatically download the js libraries to the user's system like the Gradle dependencies, so we no longer need to include them with the package. It opens door to all the packages and modules available at npm registry. Also, it can be clubbed with Grunt or Gulp implementing tasks to minify external JS and CSS files with the custom ones, see here.

      1. Add gradle-node-plugin: Gradle plugin for integrating NodeJS in your build
      2. Create NPM package.json with JS dependencies in webapp
      3. Use available tasks to install dependencies
      https://github.com/node-gradle/gradle-node-plugin/blob/master/docs/usage.md#executing-npm-tasks
      https://github.com/node-gradle/gradle-node-plugin/blob/master/docs/usage.md#configuring-the-plugin
      4. Use the downloaded JS files in node_modules, updating the current path of the JS files.

      Attachments

        Issue Links

          Activity

            People

              jleroux Jacques Le Roux
              adityasharma Aditya Sharma
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: