terrierscript / cssjoin Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] Use postcss-import https://github.com/postcss/postcss-import
[DEPRECATED] Use postcss-import https://github.com/postcss/postcss-import
If an url has a query string, then the file will not exist at that path (statSync fails), so the url will not be remapped.
eg.url('../fonts/fontawesome-webfont.eot?v=4.0.3');
Sorry I am new to Git Hub and don't know how to do a proper pull request yet, but here is my fix to replace the function in /lib/util.js:
function resolvePath(file, resolvePaths){
var pathname = null;
//paths
var paths = resolvePaths.concat(); //deep copy
paths.unshift('.');
for (var i = 0; i < paths.length; i++) {
try {
pathname = path.join(paths[i], file);
// MOD: begin
var filename = null;
var queryIndex = pathname.indexOf('?');
var filename = (queryIndex >= 0) ? pathname.substring(0, queryIndex) : pathname;
fs.statSync(filename);
//fs.statSync(pathname);
// MOD: end
return pathname;
} catch (e) {
pathname = null;
}
}
return pathname;
}
Create screen.css
with following content (which is already compressed)
@import 'blah.css';p { width:1px;height:1px }
Content of blah.css
is
p { color:#FFF }
Run cssjoin screen.css
p { color:#FFF }p { width:1px;height:1px }
p { color:#FFF }
height:1px }
For example, I have this kind of file:
@import "/res/css/reset.css";
@import "/res/css/base/base.css";
But I want to resole files with path prefix build/grunt
, so that files need to be searched in combined path "build/grunt/res/css/reset.css".
Is it possible to add support for files with the .scss/.sass extension?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.