Skip to content

Instantly share code, notes, and snippets.

@swapnilshrikhande
Created September 9, 2021 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swapnilshrikhande/d4572ae5e80c80aa48bcae1c75760797 to your computer and use it in GitHub Desktop.
Save swapnilshrikhande/d4572ae5e80c80aa48bcae1c75760797 to your computer and use it in GitHub Desktop.
Merge Angular Project into Spring Boot project
# script to create a new project
# The Angular CLI can be used to generate new application scaffolding, as well as other things. It’s a useful starting point, but you could # at this point grab any existing Angular app and put it in the same place. We want to work with the Angular app in the top level directory
# to keep all the tools and IDEs happy, but we also want make it look like a regular Maven build.
# Create the app with the CLI:
# $ ./ng new client # add --minimal here if you want to skip tests
cat $1/.gitignore >> .gitignore
rm -rvf $1/node* $1/src/favicon.ico $1/.gitignore $1/.git
sed -i -e 's/node_/anode/' .gitignore
cp -rvf $1/* .
cp $1/.??* .
rm -rvf $1
sed -i -e 's,dist/$1,target/$1/static,' angular.json
# We discarded the node modules that the CLI installed because we want the frontend plugin to do that work for us in an automated build. We
# also edited the angular.json (a bit like a pom.xml for the Angular CLI app) to point the output from the Angular build to a location that
# will be packaged in our JAR file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment