config.js 1.9 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(path.join('wagtail', 'admin'), {'appName': 'wagtailadmin'}),
  24. new App(path.join('wagtail', 'documents'), {'appName': 'wagtaildocs'}),
  25. new App(path.join('wagtail', 'embeds'), {'appName': 'wagtailembeds'}),
  26. new App(path.join('wagtail', 'images'), {'appName': 'wagtailimages'}),
  27. new App(path.join('wagtail', 'search'), {'appName': 'wagtailsearch'}),
  28. new App(path.join('wagtail', 'snippets'), {'appName': 'wagtailsnippets'}),
  29. new App(path.join('wagtail', 'users'), {'appName': 'wagtailusers'}),
  30. new App(path.join('wagtail', 'contrib', 'styleguide'), {'appName': 'wagtailstyleguide'}),
  31. new App(path.join('wagtail', 'contrib', 'settings'), {'appName': 'wagtailsettings'}),
  32. new App(path.join('wagtail', 'contrib', 'modeladmin'), {'appName': 'wagtailmodeladmin'}),
  33. new App(path.join('wagtail', 'contrib', 'typed_table_block'), {'appName': 'typed_table_block'}),
  34. ];
  35. module.exports = {
  36. apps: apps,
  37. srcDir: srcDir,
  38. destDir: destDir,
  39. // Determines whether the pipeline is used in production or dev mode.
  40. isProduction: process.env.NODE_ENV === 'production',
  41. };