File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed
Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ module.exports = function findFile(startPath, uri) {
5656 * @returns {boolean } True where a package.json or bower.json exists, else False
5757 */
5858 function testWithinProject ( absolutePath ) {
59- return ( path . relative ( absoluteStart , process . cwd ( ) ) . charAt ( 0 ) === '.' ) ;
59+ return ( path . relative ( absolutePath , process . cwd ( ) ) . charAt ( 0 ) === '.' ) ;
6060 }
6161
6262 /**
Original file line number Diff line number Diff line change 11{
22 "name" : " resolve-url-loader" ,
3- "version" : " 1.0.0 " ,
4- "description" : " Webpack loader that resolves an absolute path of url() statements based on the original file" ,
3+ "version" : " 1.0.1 " ,
4+ "description" : " Webpack loader that resolves relative paths in url() statements based on the original source file" ,
55 "main" : " index.js" ,
66 "scripts" : {
77 "test" : " echo \" Error: no test specified\" && exit 1"
Original file line number Diff line number Diff line change 22
33[ ![ NPM] ( https://nodei.co/npm/resolve-url-loader.png )] ( http://github.com/bholloway/resolve-url-loader )
44
5- Webpack loader that rsesolves an absolute path of url() statements based on the original file.
5+ Webpack loader that resolves relative paths in url() statements based on the original source file
66
77Use in conjunction with the [ sass-loader] ( https://www.npmjs.com/package/sass-loader ) and specify your assets relative
8- to the ` sass ` file in question. This plugin will use the source-map from the ` sass ` compiler to locate the original file
8+ to the ` sass ` file in question. This loader will use the source-map from the ` sass ` compiler to locate the original file
99and write a more complete path for your asset. Subsequent build steps can then locate your asset for processing.
1010
1111## Usage
@@ -57,7 +57,16 @@ module.exports = {
5757};
5858```
5959
60- ### Options
60+ ## How it works
61+
62+ A [ rework] ( https://github.com/reworkcss/rework ) process is run on incoming ` css ` . The incoming source-map is used to
63+ resolve the original file where there was some preceding transpile step (such as SASS).
64+
65+ Url() statements are identified and a search is begun, commencing at the original file. In some cases there is no
66+ immediate match (<cough >bootstrap</cough >) and we search both deeper and shallower from the starting directory. The
67+ search will proceed until
68+
69+ ## Options
6170
6271* ` absolute ` Forces the url() to be resolved to an absolute path. This is considered
6372[ bad practice] ( http://webpack.github.io/docs/how-to-write-a-loader.html#should-not-embed-absolute-paths ) so only do it
You can’t perform that action at this time.
0 commit comments