There is a project written on angular2 , then I collect it with a webpack, I get 2 files (app.bundle.js, vendor.bundle.js) which are in the dist directory. Is it possible to somehow build a project with the help of gradle and then throw it on tomcat? I just started my acquaintance with gradle, that's why this question arose. Wrote such a build.gradle

plugins { id "com.eriwen.gradle.js" version "2.14.1" id "com.craigburke.client-dependencies" version "1.1.4" } apply plugin: "application" apply plugin: 'war' repositories { mavenCentral() } configurations { providedRuntime } task wrapper(type: Wrapper) { gradleVersion = "1.12" } clientDependencies { npm { '@angular/common'('2.0.0-rc.4', into: '@angular/common'){ include 'index.js' } '@angular/compiler'('2.0.0-rc.4', into: '@angular/compiler'){ include 'index.js' } '@angular/core'('2.0.0-rc.4', into: '@angular/core'){ include 'index.js' } '@angular/http'('2.0.0-rc.4', into: '@angular/http'){ include 'index.js' } '@angular/platform-browser'('2.0.0-rc.4', into: '@angular/platform-browser'){ include 'index.js' } '@angular/platform-browser-dynamic'('2.0.0-rc.4', into: '@angular/platform-browser-dynamic'){ include 'index.js' } '@angular/router'('3.0.0-beta.2', into: '@angular/router'){ include 'index.js' } '@angular/router-deprecated'('2.0.0-rc.2', into: '@angular/router-deprecated/bundles'){ include 'router-deprecated.umd.js' include 'router-deprecated.umd.min.js' } '@angular/upgrade'('2.0.0-rc.4', into: '@angular/upgrade'){ include 'index.js' } 'angular2-in-memory-web-api'('0.0.14', into: 'angular2-in-memory-web-api'){ include 'index.js' } 'core-js'('^2.4.0', into: 'core-js/client'){ include 'shim.js' include 'shim.min.js' } 'reflect-metadata'('^0.1.3', into: 'reflect-metadata'){ include 'Reflect.js' } 'systemjs'('0.19.31', into: 'systemjs/dist'){ include 'system.src.js' } 'zone.js'('^0.6.12', into: 'zone.js/dist'){ include 'zone.js' include 'zone.min.js' } } 

    1 answer 1

    here so collects js files in and adds html there

     plugins { id "com.eriwen.gradle.js" version "2.14.1" id "com.craigburke.client-dependencies" version "1.1.4" } apply plugin: "application" apply plugin: 'war' repositories { mavenCentral() } configurations { providedRuntime } task wrapper(type: Wrapper) { gradleVersion = "1.12" } war { from "index.html" with { from "dist/app.bundle.js" into '/js/' } with { from "dist/vendor.bundle.js" into '/js/' } } 
    • It remains only to make it work from the archive - Alexandr Semenets
    • necessary css-files are added in the same way as html and js - Alexandr Semenets