config.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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/snippets', {'appName': 'wagtailsnippets'}),
  28. new App('wagtail/users', {'appName': 'wagtailusers'}),
  29. new App('wagtail/contrib/styleguide', {'appName': 'wagtailstyleguide'}),
  30. new App('wagtail/contrib/settings', {'appName': 'wagtailsettings'}),
  31. new App('wagtail/contrib/modeladmin', {'appName': 'wagtailmodeladmin'}),
  32. ];
  33. module.exports = {
  34. apps: apps,
  35. srcDir: srcDir,
  36. destDir: destDir,
  37. // Determines whether the pipeline is used in production or dev mode.
  38. isProduction: process.env.NODE_ENV === 'production',
  39. };