copy.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. * `tasks/config/copy`
  3. *
  4. * ---------------------------------------------------------------
  5. *
  6. * Copy files and/or folders from your `assets/` directory into
  7. * the web root (`.tmp/public`) so they can be served via HTTP,
  8. * and also for further pre-processing by other Grunt tasks.
  9. *
  10. * For more information, see:
  11. * https://sailsjs.com/anatomy/tasks/config/copy.js
  12. *
  13. */
  14. module.exports = function(grunt) {
  15. grunt.config.set('copy', {
  16. dev: {
  17. files: [{
  18. expand: true,
  19. cwd: './assets',
  20. src: ['**/*.!(coffee|less)'],
  21. dest: '.tmp/public'
  22. }]
  23. },
  24. build: {
  25. files: [{
  26. expand: true,
  27. cwd: '.tmp/public',
  28. src: ['**/*'],
  29. dest: 'www'
  30. }]
  31. }
  32. });
  33. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  34. // This Grunt plugin is part of the default asset pipeline in Sails,
  35. // so it's already been automatically loaded for you at this point.
  36. //
  37. // Of course, you can always remove this Grunt plugin altogether by
  38. // deleting this file. But check this out: you can also use your
  39. // _own_ custom version of this Grunt plugin.
  40. //
  41. // Here's how:
  42. //
  43. // 1. Install it as a local dependency of your Sails app:
  44. // ```
  45. // $ npm install grunt-contrib-copy --save-dev --save-exact
  46. // ```
  47. //
  48. //
  49. // 2. Then uncomment the following code:
  50. //
  51. // ```
  52. // // Load Grunt plugin from the node_modules/ folder.
  53. // grunt.loadNpmTasks('grunt-contrib-copy');
  54. // ```
  55. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  56. };