Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Eyeglass #701

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
_normalize.scss
7 changes: 7 additions & 0 deletions eyeglass-exports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var path = require('path');

module.exports = function(eyeglass, sass) {
return {
sassDir: path.join(__dirname)
}
}
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,26 @@
"style": "normalize.css",
"files": [
"LICENSE.md",
"normalize.css"
"normalize.css",
"eyeglass-exports.js",
"to-sass.js"
],
"eyeglass": {
"needs": "^1.0.0",
"exports": "eyeglass-exports.js",
"name": "normalize"
},
"devDependencies": {
"stylelint": "^7.9.0",
"stylelint-config-standard": "^16.0.0"
},
"scripts": {
"test": "stylelint normalize.css"
"test": "stylelint normalize.css",
"postinstall": "node ./to-sass.js"
},
"keywords": [
"eyeglass-module"
],
"repository": "necolas/normalize.css",
"license": "MIT",
"bugs": "https://github.com/necolas/normalize.css/issues",
Expand Down
21 changes: 21 additions & 0 deletions to-sass.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';

var fs = require('fs');
var path = require('path');

const pkg = require('./package.json');

// Output file paths
var input = path.join(__dirname, pkg.main);
var output = path.join(__dirname, '_' + path.basename(pkg.main, '.css') + '.scss');

// Clean up Sass file if it's already there
try {
fs.statSync(output);
fs.unlink(output);
} catch(e) {
// It's OK if this errors, it means the file doesn't exist
}

// Cpoy input file to output file
fs.writeFileSync(output, fs.readFileSync(input));