builder-amd-css
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -50,4 +50,9 @@ var requireCssFiles, | ||
loadFile: function( path ) { | ||
var data; | ||
path = normalizePath( path ); | ||
return files[ path ]; | ||
data = files[ path ]; | ||
if ( config.onCssBuildWrite ) { | ||
data = config.onCssBuildWrite( path, data ); | ||
} | ||
return data; | ||
} | ||
@@ -54,0 +59,0 @@ }; |
{ | ||
"name": "builder-amd-css", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -14,3 +14,3 @@ var files, | ||
describe( "The CSS dependencies of a JS file", function() { | ||
describe( "CSS dependencies of a JS file", function() { | ||
var css; | ||
@@ -25,3 +25,3 @@ | ||
it( "must be included", function() { | ||
it( "should be included", function() { | ||
expect( css ).to.equal( ".bar {}\n" ); | ||
@@ -32,3 +32,3 @@ }); | ||
describe( "The CSS dependencies of JS dependencies", function() { | ||
describe( "CSS dependencies of JS dependencies", function() { | ||
var css; | ||
@@ -43,3 +43,3 @@ | ||
it( "must be included", function() { | ||
it( "should be included", function() { | ||
expect( css ).to.equal( ".foo {}\n.bar {}\n" ); | ||
@@ -50,3 +50,3 @@ }); | ||
describe( "Using appDir", function() { | ||
describe( "Property appDir", function() { | ||
var css, files; | ||
@@ -74,3 +74,3 @@ | ||
describe( "Using appDir and CSSes located in a different subdir", function() { | ||
describe( "Property appDir plus CSSes located in a sibling subdir", function() { | ||
var css, files; | ||
@@ -147,3 +147,3 @@ | ||
it( "must be enqueued", function() { | ||
it( "should be enqueued", function() { | ||
expect( barCss ).to.equal( ".bar {}\n" ); | ||
@@ -155,1 +155,25 @@ expect( fooCss ).to.equal( ".foo {}\n.bar {}\n" ); | ||
describe( "Property onCssBuildWrite", function() { | ||
var css; | ||
before(function( done ) { | ||
AmdCssBuilder( files, { | ||
include: [ "foo" ], | ||
onCssBuildWrite: function( path, data ) { | ||
if ( /bar/.test( path ) ) { | ||
data = data.replace( /bar/, "baz" ).replace( /foo/, "qux" ); | ||
} | ||
return data; | ||
} | ||
}, function( error, _css ) { | ||
css = _css; | ||
done( error ); | ||
}); | ||
}); | ||
it( "should allow rewriting CSS content analogous to onBuildWrite for JS", function() { | ||
expect( css ).to.equal( ".foo {}\n.baz {}\n" ); | ||
}); | ||
}); | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40401
731