Grunt Usemin and Concat not working

70 Views Asked by At

I have been searching for solution regarding, Grunt Usemin, Copy tools.

Finally i have decided to write it down here.

this might help others.

Html Snippet

  <!-- build:js ${pageContext.request.contextPath}/assets/js/main.js -->
  <!-- app:js -->
  <script src="${pageContext.request.contextPath}/js/script-test-one.js"></script>
  <script src="${pageContext.request.contextPath}/js/script-test-two.js"></script>
  <script src="${pageContext.request.contextPath}/js/script-test-three.js"></script>
  <script src="${pageContext.request.contextPath}/js/script-test-four.js"></script>
  <!-- endapp -->
  <!-- endbuild -->

Grunt Build Command

grunt build

Output I am getting

└───concat
    ├───${pageContext.request.contextPath}
    │   └───assets
    │       ├───js
    │       └───style
    └───assets
        └───style

I am getting empty folders, how can i remove ${pageContext.request.contextPath}/ from the path, because when i had removed from html files things are working fine. since we need contextPath before each path this new issue has came up.

1

There are 1 best solutions below

0
Sumeet Gohil On

I have come across cdnify grunt tool where i have created to task

Clean --> Will remove ${pageContext.request.contextPath}/ prefix Dev --> Will add ${pageContext.request.contextPath}/ prefix

In Between all the others tasks are working smoothly.