config.js 1.7 KB

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