Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

How I can remove " / " when some css or js files is injecting in html file #1

Closed
mehmedju opened this Issue · 6 comments

3 participants

@mehmedju

My task is :

 injector: {
            options: {
                template:'app/index.html',
                min:true,
                ignorePath:'app/'
            },
            defaults: {
                files: {
                    'app/index.html': ['app/css/bootstrap.min.css']
                }
            }

    }

After I run command grunt injector, I got next result in my html file:

 <!-- injector:css -->
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <!-- endinjector -->

How I can remove " / " before css/bootstrap.min.css.

@joakimbeng
Owner

@mehmedju Now you can remove it by setting addRootSlash option to false :)

@mehmedju

I put so:

injector: {
        options: {
            template:'app/index.html',
            addRootSlash:false,
            ignorePath:['app/']

        },
        defaults: {
            files: {
                'app/index.html': ['app/css/bootstrap.min.css']
            }
        }

},

Again same issue :(

@joakimbeng
Owner

And you are sure you've updated to the new version? (v0.5.1)

@mehmedju

I didn't do that..Now it works great...
Tnx a lot !!!

@joakimbeng
Owner

No problem!

@dman777

addRootSlash does not seem to be effective in grunt-injector@0.5.2.

  injector: {
            options: {
            destFile : 'app/static/index.html',
            addRootSlash: false,
            ignorePath: 'app/static'
            }, 
                files: {
                    expand: true,
                    cwd: 'app/static/css',
                    src: ['*.css'],
                    dest: '../',
                    ext: '.css'
                    }
        }, 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.