Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Commit de69374

Browse files
committedNov 18, 2013
initial commit
0 parents  commit de69374

File tree

6 files changed

+106
-0
lines changed

6 files changed

+106
-0
lines changed
 

‎.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
webmake-sass.sublime-workspace
2+
webmake-sass.sublime-project

‎.npmignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
webmake-sass.sublime-workspace
2+
webmake-sass.sublime-project

‎LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2013 Adam Daniel
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

‎README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# webmake-sass
2+
3+
## Require SASS files with [Webmake](https://github.com/medikoo/modules-webmake)
4+
5+
To use this extension, install it aside of Webmake:
6+
7+
$ npm install webmake-sass
8+
9+
If you use global installation of Webmake, then extension also needs to be installed globally:
10+
11+
$ npm install -g webmake-sass
12+
13+
When running Webmake, ask webmake to use it:
14+
15+
$ webmake --ext=sass program.js bundle.js
16+
17+
Same way when Webmake is used programmatically:
18+
19+
webmake(inputPath, { ext: 'sass' }, cb);
20+
21+
webmake-sass can be used with any other Webmake extension, e.g.:
22+
23+
$ webmake --ext=sass --ext=otherext program.js bundle.js
24+
25+
Programmatically:
26+
27+
require('./path/to/sassfile'); // injects the resulting CSS automatically into the current page

‎index.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
var sass = require('node-sass'),
2+
path = require('path'),
3+
deferred = require('deferred');
4+
5+
exports.extension = ['sass'];
6+
exports.type = 'css';
7+
8+
function compileSass(src, info) {
9+
var def = deferred();
10+
sass.render({
11+
data: src,
12+
includePaths: [path.dirname(info.filename)],
13+
success: function (css) {
14+
return def.resolve(css);
15+
},
16+
error: function (err) {
17+
return def.reject(new Error(err));
18+
}
19+
});
20+
return def.promise;
21+
}
22+
23+
exports.compile = function (src, info) {
24+
return { code: compileSass(src, info) };
25+
};

‎package.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "webmake-sass",
3+
"version": "0.1.0",
4+
"description": "Require SASS files with Webmake",
5+
"keywords": [
6+
"browser",
7+
"browserify",
8+
"bundle",
9+
"cjs",
10+
"commonjs",
11+
"deploy",
12+
"json",
13+
"make",
14+
"require",
15+
"css",
16+
"sass",
17+
"web",
18+
"webmake"
19+
],
20+
"author": "Adam Daniel <adam@acdaniel.com>",
21+
"dependencies": {
22+
"deferred": "~0.6.5",
23+
"node-sass": "~0.7.0"
24+
},
25+
"peerDependencies": {
26+
"webmake": "~0.3.19"
27+
},
28+
"license": "MIT"
29+
}

0 commit comments

Comments
 (0)
This repository has been archived.