Skip to content
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

does not work with <!-- inject:js --> or <!-- inject:js --> #133

Open
eugenekgn opened this issue Sep 18, 2015 · 2 comments
Open

does not work with <!-- inject:js --> or <!-- inject:js --> #133

eugenekgn opened this issue Sep 18, 2015 · 2 comments
Assignees

Comments

@eugenekgn
Copy link

<!-- build:js js/app.js -->
<!-- inject:js -->
<script src="/src/app/app.module.js"></script>
<script src="/src/app/home/home.module.js"></script>
<script src="/src/app/products/product.module.js"></script>
<script src="/src/app/home/home.directives.js"></script>
<script src="/src/app/products/product.services.js"></script>
<script src="/src/app/products/productDetail.controller.js"></script>
<script src="/src/app/products/productEdit.controller.js"></script>
<script src="/src/app/products/productList.controller.js"></script>
<script src="/src/app/common/services/common.services.js"></script>
<script src="/src/app/common/services/product.services.mock.js"></script>
<!-- endinject -->

<!-- inject:templates:js -->

It works without inject:xx but not with

here's my code

gulp.task('optimize', ['inject'], function () {

var assets = $.useref.assets({ searchPath: './' });
var templateCache = config.temp + config.templateCache.file;

return gulp
    .src(config.index)
    .pipe($.plumber())
    .pipe($.inject(gulp.src(templateCache, {
        read: false,
        starttag: '<!-- inject:templates:js -->'
    })))
    .pipe(assets)                           // Gathers assets from html comments
    .pipe(assets.restore())                 // Restores the files to the stream. ex: index.html
    .pipe($.useref())                       // $.useref(): concatenates all files
    .pipe(gulp.dest(config.dist));

});

@jonkemp
Copy link
Owner

jonkemp commented Oct 23, 2015

This would be an issue for the https://github.com/digisfera/useref repo. However, https://github.com/taptapship/wiredep might be an alternative solution that would work.

@jonkemp
Copy link
Owner

jonkemp commented Nov 11, 2015

@eugenekgn my guess is this doesn't work because the comments are stripped out. Can you confirm this?

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