systemjs-plugin-css
Advanced tools
Comparing version
@@ -0,0 +0,0 @@ SystemJS.config({ |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ exports.postcss = require('postcss'); |
@@ -125,3 +125,3 @@ var fs = require('@node/fs'); | ||
url: function(fileName, decl, from, dirname, to, options, result) { | ||
if ((absUrl(fileName) && fileName.charAt(0) !== '/') || fileName.match(/^%23/)) | ||
if ((absUrl(fileName) && (!loader.browserRootURL || fileName.charAt(0) !== '/')) || fileName.match(/^%23/)) | ||
return fileName; | ||
@@ -128,0 +128,0 @@ |
@@ -0,0 +0,0 @@ /* |
@@ -0,0 +0,0 @@ if (typeof window !== 'undefined') { |
{ | ||
"name": "systemjs-plugin-css", | ||
"version": "0.1.36", | ||
"version": "0.1.37", | ||
"main": "css", | ||
@@ -5,0 +5,0 @@ "registry": "jspm", |
@@ -0,0 +0,0 @@ css |
@@ -0,0 +0,0 @@ System.registerDynamic("test/data/test.css!css.js", [], false, function ($__require, $__exports, $__module) { |
@@ -0,0 +0,0 @@ describe('CSS Browser Injector', function(){ |
@@ -28,2 +28,37 @@ var fs = require('fs') | ||
describe('with a browserRootURL config', function () { | ||
it('should preprend it to a relative url(...) reference', function () { | ||
var builder = new Builder(); | ||
builder.config(System.getConfig()); | ||
builder.config({ | ||
browserRootURL: 'https://example.com/', | ||
rootURL: './test' | ||
}); | ||
return builder.compile('test/data/test.css!', {minify: false}).then((results) => { | ||
return expect(results.source).to.contain("body{background-color:red;background-image:url(https://example.com/data/x.png)}"); | ||
}); | ||
}); | ||
it('should preprend it to a root-relative url(...) reference', function () { | ||
var builder = new Builder(); | ||
builder.config(System.getConfig()); | ||
builder.config({ | ||
browserRootURL: 'https://example.com/', | ||
rootURL: './test' | ||
}); | ||
return builder.compile('test/data/rootRelative.css!', {minify: false}).then((results) => { | ||
return expect(results.source).to.contain("body{background-color:red;background-image:url(https://example.com/path/to/x.png)}"); | ||
}); | ||
}); | ||
}); | ||
// https://github.com/systemjs/plugin-css/pull/135#commitcomment-24415595 | ||
it('should handle a root-relative url when no rootURL and no browserRootURL are configured', function () { | ||
var builder = new Builder(); | ||
builder.config(System.getConfig()); | ||
return builder.compile('test/data/rootRelative.css!', {minify: false}).then((results) => { | ||
return expect(results.source).to.contain("body{background-color:red;background-image:url(/path/to/x.png)}"); | ||
}); | ||
}); | ||
it('Should support buildCSS: false', function() { | ||
@@ -30,0 +65,0 @@ var builder = new Builder(); |
@@ -0,0 +0,0 @@ /* eslint-disable */ |
@@ -0,0 +0,0 @@ var page = require('webpage').create(); |
@@ -0,0 +0,0 @@ module.exports = function(System){ |
@@ -0,0 +0,0 @@ /* eslint-disable */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4329640
0.08%2406
1.56%