Giter Site home page Giter Site logo

angular-boilerplate's Introduction

Angular boilerplate

Boilerplate project demonstrating how to integrate Angular with classic Maven based JavaEE projects.

The build process

Beside building and packaging the Java webapp, the build also performs the following steps:

  • The frontend-maven-plugin downloads and installs both NodeJS and the Yarn package manager locally in your project folder. Therefor you don't have to install NodeJS manually on your box to run the build.
  • The build runs yarn install to download all dependencies from the npm repository.
  • Then it executes Webpack which will use the TypeScript compiler to build you source code and merge it to a minified JavaScript bundle.
  • The corresponding output bundle will then be packaged together with all other assets in your WAR file.

So if you run mvn install, both the Java server code and the Angular code will be compiled and packaged into the WAR in a single step.

Development mode

For development your can use the webpack-dev-server which provides a very efficient development experience.

The webpack-dev-server will act as a reverse proxy for your Java application server. It will listen on port 9999 and forward all requests to your actual application server which is typically available at localhost:8080. The only exception to this are requests for the Webpack JavaScript bundles. Requests for these assets are not forwarded but served by the webpack-dev-server which will recompile the bundles whenever source files change.

This default Webpack configuration in this project assumes that the deployed application is available via http://localhost:8080/angular-boilerplate. If your setup is different, you will have to adjust the devServer section in webpack.config.js.

To start the webpack-dev-server, execute the following script:

./dev-server.sh

Then you can open your application using this URL:

http://localhost:9999/angular-boilerplate/

You can now modify the TypeScript source code and reload the page. You will see that the webpack-dev-server will automatically recompile and serve the new code.

angular-boilerplate's People

Contributors

chkal avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.