Skip to content

Commit

Permalink
fix(importer): search for css files in root dir and resolve import error
Browse files Browse the repository at this point in the history
fixes #558
  • Loading branch information
JeroenVinke committed Mar 21, 2017
1 parent b01a095 commit 9a0da9e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 7 additions & 2 deletions lib/importer/services/resource-inclusion.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ let ResourceInclusion = class {
}

getCSS() {
let globExpr = '?(dist|build|lib|css|style|styles})/**/*.css';
let subdirs = '?(dist|build|lib|css|style|styles)/**/*.css';
let curDir = '*.css';

return this.getResources(globExpr)
return Promise.all([
this.getResources(subdirs),
this.getResources(curDir)
])
.then(cssFiles => cssFiles[0].concat(cssFiles[1]))
.then(cssFiles => {
if (cssFiles.length === 0) {
return [];
Expand Down
7 changes: 4 additions & 3 deletions lib/importer/strategies/jspm-section.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ let JSPMSectionStrategy = class {

execute() {
let jspm = this.package.packageJSON.jspm;
let main = jspm.main || this.package.packageJSON.main;
let directories = jspm.directories;
let distFolder = '';

Expand All @@ -30,10 +31,10 @@ let JSPMSectionStrategy = class {
}

this.package.path = path.posix.join('../node_modules/', this.package.name, distFolder);
this.package.main = jspm.main;
this.package.main = main;

if (jspm.shim && jspm.shim[configuration.main]) {
let shim = jspm.shim[configuration.main];
if (jspm.shim && jspm.shim[main]) {
let shim = jspm.shim[main];
this.package.deps = shim.deps;
this.package.exports = shim.exports;
}
Expand Down

0 comments on commit 9a0da9e

Please sign in to comment.