config.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. var path = require('path');
  2. var srcDir = 'static_src';
  3. var destDir = 'static';
  4. var App = function(dir, options) {
  5. this.dir = dir;
  6. this.options = options || {};
  7. this.appName = this.options.appName || path.basename(dir);
  8. this.sourceFiles = path.join('.', this.dir, srcDir);
  9. };
  10. App.prototype = Object.create(null);
  11. App.prototype.scssIncludePaths = function() {
  12. return [this.sourceFiles];
  13. };
  14. App.prototype.scssSources = function() {
  15. // Assume that any scss we care about is always within the expected
  16. // "appname/static_url/appname/scss/" folder.
  17. // NB: this requires the user to adhere to sass's underscore prefixing
  18. // to tell the compiler what files are includes.
  19. return path.join(this.sourceFiles, this.appName, '/scss/**/*.scss')
  20. };
  21. // All the Wagtail apps that contain static files
  22. var apps = [
  23. new App('wagtail/wagtailadmin'),
  24. new App('wagtail/wagtaildocs'),
  25. new App('wagtail/wagtailembeds'),
  26. new App('wagtail/wagtailimages'),
  27. new App('wagtail/wagtailsnippets'),
  28. new App('wagtail/wagtailusers'),
  29. new App('wagtail/contrib/wagtailstyleguide'),
  30. new App('wagtail/contrib/settings', {
  31. 'appName': 'wagtailsettings',
  32. }),
  33. new App('wagtail/contrib/modeladmin', {
  34. 'appName': 'wagtailmodeladmin',
  35. }),
  36. ];
  37. module.exports = {
  38. apps: apps,
  39. srcDir: srcDir,
  40. destDir: destDir
  41. }