A
A
Anna Bakurova2015-07-09 10:47:20
Grunt.js
Anna Bakurova, 2015-07-09 10:47:20

How to set up a grant for multiple versions of a project?

Task:
Set up a grant file that is located in the root folder of the project on a par with the desktop, mobile, tablet versions of the project
Location of folders in the root:
fd6832095e52483fa49560760e1a7dfd.png
Location of folders in the project version:
31b390e082cb40d4ac13f451c01dbb6f.png
Problem:
Each project has a less folder to which grunt less compression and other grunt plugins are applied , it is necessary that the compiled css is placed in the dist->css folder of this project.
I don't want to write different tasks for the grant. Is it possible to somehow set the folder for saving files in the project relative to the project in which changes occur, while the grant is common to everyone, since it performs the same tasks and it’s enough to switch the grant when moving to another project folder.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2015-07-09
@Libris

And what's the problem with writing a task for each version?

less: {
  options: {
    compress: true
  },

  desktop: {
    files: {
      'desktop/style/app.css': 'desktop/style/app.less'
    }
  },

  tablet: {
    files: {
      'tablet/style/app.css': 'tablet/style/app.less'
    }
  }
}

Then call as grunt less:tablet or grunt less:desktop respectively.
Well, with the help of templates , this code can also be shortened and eliminated from duplication.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question