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

map all image files #1

Open
nathanredblur opened this issue Jan 21, 2016 · 0 comments
Open

map all image files #1

nathanredblur opened this issue Jan 21, 2016 · 0 comments

Comments

@nathanredblur
Copy link

Hi
I need to search in all css and jade files all references files that start with '/assets/' and replace it for the cdn url.

img(src='/uploads/images/image1.jpg')
...
img(src='/uploads/images/image999.jpg')

to

img(src='//cdn.my-cdn.com/uploads/images/image1.jpg')
...
img(src='//cdn.my-cdn.com/uploads/images/image999.jpg')

I have this

local2cdn: {
      dist: {
        options: {
          prefix: '//cdn.my-cdn.com',
          maps: [
            {local: '\/assets\/', cdn: '/assets/',  srcType:'image', regex:true}
          ]
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>/public/css/',
          src: '*.css',
          dest: '<%= yeoman.dist %>/xx/public/css/'
        },{
          expand: true,
          cwd: '<%= yeoman.dist %>/server/views/',
          src: '{,*/}*.jade',
          dest: '<%= yeoman.dist %>/xx/server/views/'
        }]
      }
    },

How can I do this?

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

1 participant