about summary refs log tree commit diff
path: root/config/webpack/configuration.js
diff options
context:
space:
mode:
authorkibigo! <marrus-sh@users.noreply.github.com>2017-11-20 22:13:37 -0800
committerkibigo! <marrus-sh@users.noreply.github.com>2017-11-20 22:13:37 -0800
commitbdbbd06dad298dc3e1a5f568f4a3ff3635b48f22 (patch)
tree1a475460389053b41f293d27f7c915f0d545d4ad /config/webpack/configuration.js
parent321fa41930f8a11356939a1684ff153f2f46443b (diff)
Finalized theme loading and stuff
Diffstat (limited to 'config/webpack/configuration.js')
-rw-r--r--config/webpack/configuration.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/config/webpack/configuration.js b/config/webpack/configuration.js
index 74f75d89b..9514bc547 100644
--- a/config/webpack/configuration.js
+++ b/config/webpack/configuration.js
@@ -12,14 +12,24 @@ const settings = safeLoad(readFileSync(configPath), 'utf8')[env.NODE_ENV];
 const themeFiles = glob.sync('app/javascript/themes/*/theme.yml');
 const themes = {};
 
+const core = function () {
+  const coreFile = resolve('app', 'javascript', 'core', 'theme.yml');
+  const data = safeLoad(readFileSync(coreFile), 'utf8');
+  if (!data.pack_directory) {
+    data.pack_directory = dirname(coreFile);
+  }
+  return data.pack ? data : {};
+}();
+
 for (let i = 0; i < themeFiles.length; i++) {
   const themeFile = themeFiles[i];
   const data = safeLoad(readFileSync(themeFile), 'utf8');
+  data.name = basename(dirname(themeFile));
   if (!data.pack_directory) {
     data.pack_directory = dirname(themeFile);
   }
   if (data.pack) {
-    themes[basename(dirname(themeFile))] = data;
+    themes[data.name] = data;
   }
 }
 
@@ -43,6 +53,7 @@ const output = {
 
 module.exports = {
   settings,
+  core,
   themes,
   env,
   loadersDir,