Skip to content

Commit afa88fa

Browse files
committed
getting the CSS output correct, just the variable rewriting to go
1 parent 126464c commit afa88fa

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

src/file-system-loader.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ export default class FileSystemLoader {
1414
return new Promise( ( resolve, reject ) => {
1515
let rootRelativePath = path.resolve( path.dirname( relativeTo ), newPath ),
1616
fileRelativePath = this.root + rootRelativePath
17-
console.log( newPath )
18-
console.log( relativeTo )
19-
console.log( rootRelativePath )
20-
console.log( fileRelativePath )
2117

2218
fs.readFile( fileRelativePath, "utf-8", ( err, source ) => {
2319
if ( err ) reject( err )

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ export default {
2121
load( sourceString, sourcePath, pathFetcher ) {
2222
let parser = new Parser( pathFetcher )
2323

24+
console.log("PROCESSING " + sourcePath)
2425
return postcss( this.plugins.concat( [parser.plugin] ) )
2526
.process( sourceString, { from: "/" + sourcePath } )
2627
.then( result => {
27-
return Promise.resolve( { injectableSource: result.css, exportTokens: parser.exportTokens } )
28+
console.log("GOT RESULT " + sourcePath)
29+
return { injectableSource: result.css, exportTokens: parser.exportTokens }
2830
} )
2931
}
3032
}

src/parser.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default class Parser {
99
}
1010

1111
plugin( css, result ) {
12-
Promise.all( this.fetchAllImports( css ) ).then( _ => {
12+
return Promise.all( this.fetchAllImports( css ) ).then( _ => {
1313
css.each( node => {
1414
if ( node.type == "rule" && node.selector == ":export" ) this.handleExport( node )
1515
} )
@@ -37,9 +37,10 @@ export default class Parser {
3737

3838
fetchImport( importNode, relativeTo ) {
3939
let file = importNode.selector.match( importRegexp )[1]
40-
console.log(file, relativeTo)
40+
importNode.removeSelf()
4141
return this.pathFetcher(file, relativeTo).then(exports => {
42+
console.log("got export")
4243
console.log(exports)
43-
})
44+
}, err => console.log(err))
4445
}
4546
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.__global_blackShadow {
22
box-shadow: 0 0 10px -2px black;
33
}
4-
54
.__globalName {
65
color: red;
76
}

0 commit comments

Comments
 (0)