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

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

Closed
mehmedju opened this issue Feb 21, 2014 · 6 comments
Closed

Comments

@mehmedju
Copy link

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
Copy link
Member

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

@mehmedju
Copy link
Author

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
Copy link
Member

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

@mehmedju
Copy link
Author

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

@joakimbeng
Copy link
Member

No problem!

@dman777
Copy link

dman777 commented Jul 15, 2014

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants