Skip to content

Dist injecting js & css debug files in index.html #1646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Gusi opened this issue Feb 19, 2016 · 2 comments
Closed

Dist injecting js & css debug files in index.html #1646

Gusi opened this issue Feb 19, 2016 · 2 comments

Comments

@Gusi
Copy link

Gusi commented Feb 19, 2016

Hi,
I have a very strange problem that I'm unable to track down. When building a dist version (grunt build:dist or grunt serve:dist) the index.html gets injected with the vendor and app minified files, but also with all the debug files between and tags.

The strangest thing is that it happens randomly, without any clue about when it's going to fail. I've tried with a clean index.html file direct from the yeoman output, and it also fails sometimes.

Any clue about what could be happening?

<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
  <head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <base href="/">
    <title></title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width">
    <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
    <link rel="stylesheet" href="app/vendor.c5be4e5a.css">
    <!-- build:css({.tmp,client}) app/app.css -->
      <link rel="stylesheet" href="app/app.033da421.css">
      <!-- injector:css -->
      <link rel="stylesheet" href="app/admin/admin.css">
      <link rel="stylesheet" href="app/app.033da421.css">
      <link rel="stylesheet" href="app/bootstrap.min.css">
      <link rel="stylesheet" href="app/common.css">
      <link rel="stylesheet" href="app/font-awesome.min.css">
      <link rel="stylesheet" href="app/main/main.css">
      <link rel="stylesheet" href="components/footer/footer.css">
      <link rel="stylesheet" href="components/modal/modal.css">
      <!-- endinjector -->
    <!-- endbuild -->
  </head>
  <body ng-app="webbaseApp">
    <!--[if lt IE 7]>
      <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
    <![endif]-->

    <!-- Add your site or application content here -->
    <navbar></navbar>
    <div ui-view=""></div>
    <footer></footer>

    <!-- Google Analytics: change UA-XXXXX-X to be your site's ID -->
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-XXXXX-X');
      ga('send', 'pageview');
    </script>

    <!--[if lt IE 9]>
    <script src="bower_components/es5-shim/es5-shim.js"></script>
    <script src="bower_components/json3/lib/json3.min.js"></script>
    <![endif]-->
    <script src="app/vendor.e2d765cb.js"></script>
    <!-- build:js(.tmp) app/app.js -->
      <script src="app/app.a4af915b.js"></script>
      <!-- injector:js -->
      <script src="app/admin/admin.module.js"></script>
      <script src="components/auth/auth.module.js"></script>
      <script src="components/myUtils/myUtils.module.js"></script>
      <script src="components/util/util.module.js"></script>
      <script src="components/auth/interceptor.service.js"></script>
      <script src="app/account/settings.controller.js"></script>
      <script src="app/account/signup.controller.js"></script>
      <script src="app/admin/admin.controller.js"></script>
      <script src="app/account/account.js"></script>
      <script src="app/admin/admin.router.js"></script>
      <script src="app/app.constant.js"></script>
      <script src="app/main/main.controller.js"></script>
      <script src="app/main/main.js"></script>
      <script src="app/account/login.controller.js"></script>
      <script src="components/auth/auth.service.js"></script>
      <script src="app/account/changepassword.controller.js"></script>
      <script src="components/auth/myAuth.service.js"></script>
      <script src="components/auth/nouser.service.js"></script>
      <script src="components/auth/router.decorator.js"></script>
      <script src="components/auth/user.service.js"></script>
      <script src="components/footer/footer.directive.js"></script>
      <script src="components/modal/modal.service.js"></script>
      <script src="components/myUtils/bootstrap.decorator.js"></script>
      <script src="components/myUtils/myUtils.interceptor.service.js"></script>
      <script src="app/account/resendverificationemail.controller.js"></script>
      <script src="components/navbar/navbar.controller.js"></script>
      <script src="components/navbar/navbar.directive.js"></script>
      <script src="components/socket/socket.service.js"></script>
      <script src="app/account/resetpassword.controller.js"></script>
      <script src="components/util/util.service.js"></script>
      <!-- endinjector -->
    <!-- endbuild -->
  </body>
</html>
@Gusi
Copy link
Author

Gusi commented Feb 26, 2016

I've found the problem!
I'm on a Windows machine, and git is converting the EOL format in index.html from LF to CR+LF.

I've checked it and it only fails when the file has CR+LF, so there is a problem in the injector task. Now I know how to solve it, buy maybe the grunt task can be patched to work correcty with both LF and CR+LF formats. Any clue where to look for?

@Awk34
Copy link
Member

Awk34 commented Feb 26, 2016

#370

@Awk34 Awk34 closed this as completed Feb 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants