1
0

Gruntfile.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. 'use strict';
  2. // File is generated by
  3. // amber init
  4. //
  5. // Test code was removed manually.
  6. module.exports = function (grunt) {
  7. var path = require('path');
  8. // These plugins provide necessary tasks.
  9. grunt.loadNpmTasks('grunt-contrib-requirejs');
  10. grunt.loadNpmTasks('amber-dev');
  11. // Default task.
  12. grunt.registerTask('default', ['amberc:all']);
  13. grunt.registerTask('devel', ['amdconfig:app', 'requirejs:devel']);
  14. grunt.registerTask('deploy', ['amdconfig:app', 'requirejs:deploy']);
  15. // Project configuration.
  16. grunt.initConfig({
  17. // Metadata.
  18. // pkg: grunt.file.readJSON(''),
  19. banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
  20. '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
  21. '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
  22. '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
  23. ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
  24. // task configuration
  25. amberc: {
  26. options: {
  27. amber_dir: path.join(__dirname, "bower_components", "amber"),
  28. library_dirs: ['src'],
  29. closure_jar: ''
  30. },
  31. all: {
  32. src: [
  33. 'src/TrySmalltalk.st', // list all sources in dependency order
  34. ],
  35. amd_namespace: 'amber-trysmalltalk',
  36. libraries: ['Web']
  37. }
  38. },
  39. amdconfig: {app: {dest: 'config.js'}},
  40. requirejs: {
  41. deploy: {options: {
  42. mainConfigFile: "config.js",
  43. onBuildWrite: function (moduleName, path, contents) {
  44. return moduleName === "config" ? contents + "\nrequire.config({map:{'*':{app:'deploy'}}});" : contents;
  45. },
  46. pragmas: {
  47. excludeIdeData: true,
  48. excludeDebugContexts: true
  49. },
  50. include: ['config', 'node_modules/requirejs/require', 'deploy'],
  51. out: "the.js"
  52. }},
  53. devel: {options: {
  54. mainConfigFile: "config.js",
  55. onBuildWrite: function (moduleName, path, contents) {
  56. return moduleName === "config" ? contents + "\nrequire.config({map:{'*':{app:'devel'}}});" : contents;
  57. },
  58. include: ['config', 'node_modules/requirejs/require'],
  59. out: "the.js"
  60. }}
  61. }
  62. });
  63. };