Skip to content

Instantly share code, notes, and snippets.

@ppcano
Created February 7, 2019 00:11
Show Gist options
  • Save ppcano/77dd2e60f05751352a58e696632c91d5 to your computer and use it in GitHub Desktop.
Save ppcano/77dd2e60f05751352a58e696632c91d5 to your computer and use it in GitHub Desktop.
diff --git i/lib/models/addon.js w/lib/models/addon.js
index 2f9de9d00..1734e3604 100644
--- i/lib/models/addon.js
+++ w/lib/models/addon.js
@@ -298,6 +298,10 @@ let addonProto = {
public: 'public',
};
+ if (this.isModuleUnification()) {
+ this.treePaths.styles = 'src/ui/styles';
+ }
+
this.treeForMethods = defaultsDeep({}, DEFAULT_TREE_FOR_METHODS);
if (this.parent) {
@@ -360,7 +364,7 @@ let addonProto = {
@return {Boolean} Whether this is using a module unification format.
*/
isModuleUnification() {
- return false;
+ return this.has('src');
},
/**
@@ -1424,6 +1428,18 @@ let addonProto = {
}
},
+ /**
+ Returns whether or not the given file name is present in this project.
+
+ @private
+ @method has
+ @param {String} file File name
+ @return {Boolean} Whether or not the file is present
+ */
+ has(file) {
+ return fs.existsSync(path.join(this.root, file)) || fs.existsSync(path.join(this.root, `${file}.js`));
+ },
+
/**
Augments the applications configuration settings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment