Skip to content

allow use with lazy loading library #178

Description

@DerekLiang

Here is the sample javascript source code with ocLazyLoad at https://github.com/ocombe/ocLazyLoad/blob/master/examples/complexExample/js/app.js

I cut and paste the relevant part below:

return $ocLazyLoad.load([
                'bower_components/bootstrap/dist/css/bootstrap.css', // will use the cached version if you already loaded bootstrap with the button
                'bower_components/ocModal/dist/css/ocModal.animations.css',
                'bower_components/ocModal/dist/css/ocModal.light.css',
                'bower_components/ocModal/dist/ocModal.js',
                'partials/modal.html'
              ])

I am wondering if I can minify the css and javascript files that are referenced in a javascript file.

In detail, if I write the instructions in the comments as the following:

return $ocLazyLoad.load([
                //<!-- build:css vender.css -->
                'bower_components/bootstrap/dist/css/bootstrap.css', // will use the cached version if you already loaded bootstrap with the button
                'bower_components/ocModal/dist/css/ocModal.animations.css',
                'bower_components/ocModal/dist/css/ocModal.light.css',
                //<!-- endbuild -->

                <!-- build:js scripts/vendor.js -->
                'bower_components/ocModal/dist/ocModal.js',
                //<!-- endbuild -->

                'partials/modal.html'
              ])

it will get compiled into:

return $ocLazyLoad.load([
                 "vender.78483ea.css", 

                 "scripts/vendor.c2392b.js",

                'partials/modal.html'
              ])

Thank you for your help in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions