-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08289a8
commit 5460924
Showing
22 changed files
with
2,415 additions
and
14,551 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Dependency directories | ||
node_modules/ | ||
|
||
build/ | ||
dist/ | ||
standalone/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"extends": [ | ||
"standard", | ||
"standard-react", | ||
"prettier", | ||
"eslint:recommended" | ||
], | ||
"env": { | ||
"es6": true, | ||
"jest": true | ||
}, | ||
"plugins": [ | ||
"react", | ||
"prettier" | ||
], | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"ecmaVersion": 2018, | ||
"ecmaFeatures": { | ||
"impliedStrict": true, | ||
"jsx": true, | ||
"arrowFunctions": true, | ||
"blockBindings": true, | ||
"defaultParams": true, | ||
"destructuring": true, | ||
"forOf": true, | ||
"generators": true, | ||
"objectLiteralComputedProperties": true, | ||
"objectLiteralShorthandMethods": true, | ||
"objectLiteralShorthandProperties": true, | ||
"experimentalObjectRestSpread": true, | ||
"restParams": true, | ||
"spread": true, | ||
"templateStrings": true, | ||
"modules": true, | ||
"classes": true | ||
} | ||
}, | ||
"rules": { | ||
// don't force es6 functions to include space before paren | ||
"space-before-function-paren": 0, | ||
|
||
// allow specifying true explicitly for boolean props | ||
"react/jsx-boolean-value": 0, | ||
|
||
"max-len": [2, {"code":120,"ignoreComments":true}], | ||
|
||
"prettier/prettier": [ | ||
"error", | ||
{ | ||
"singleQuote": false, | ||
"trailingComma": "es5", | ||
"tabWidth": 2, | ||
"printWidth": 80, | ||
"semi": true, | ||
"bracketSpacing": true, | ||
"jsxBracketSameLine": false | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,50 @@ | ||
var sass = require('node-sass') | ||
var fs = require('fs') | ||
var path = require('path') | ||
var sass = require("node-sass"); | ||
var fs = require("fs"); | ||
var path = require("path"); | ||
|
||
function transferSass () { | ||
sass.render({ | ||
file: path.resolve(__dirname, '../src/index.scss'), | ||
outputStyle: 'compressed' | ||
}, function (err, result) { | ||
if (err) { | ||
console.log(err) | ||
return | ||
} | ||
var cssSource = result.css.toString() | ||
fs.writeFile(path.resolve(__dirname, '../src/style.js'), "export default '" + cssSource.replace(/\n/g, '') + "'", function (err) { | ||
function transferSass() { | ||
sass.render( | ||
{ | ||
file: path.resolve(__dirname, "../src/index.scss"), | ||
outputStyle: "compressed", | ||
}, | ||
function(err, result) { | ||
if (err) { | ||
console.error(err) | ||
console.log(err); | ||
return; | ||
} | ||
console.log('css file has been transformed to JS successful') | ||
fs.writeFile(path.resolve(__dirname, '../src/style.css'), cssSource, function (err) { | ||
if (err) { | ||
console.error(err) | ||
var cssSource = result.css.toString(); | ||
fs.writeFile( | ||
path.resolve(__dirname, "../src/style.js"), | ||
"export default '" + cssSource.replace(/\n/g, "") + "'", | ||
function(err) { | ||
if (err) { | ||
console.error(err); | ||
} | ||
console.log("css file has been transformed to JS successful"); | ||
fs.writeFile( | ||
path.resolve(__dirname, "../src/style.css"), | ||
cssSource, | ||
function(err) { | ||
if (err) { | ||
console.error(err); | ||
} | ||
console.log("css file has been transformed successful"); | ||
process.exit(); | ||
} | ||
); | ||
} | ||
console.log('css file has been transformed successful') | ||
process.exit() | ||
}) | ||
}) | ||
}) | ||
); | ||
} | ||
); | ||
} | ||
|
||
transferSass() | ||
transferSass(); | ||
|
||
fs.watch(path.resolve(__dirname, '../src/index.scss'), function (event, filename) { | ||
console.log(event, filename) | ||
transferSass() | ||
}) | ||
fs.watch(path.resolve(__dirname, "../src/index.scss"), function( | ||
event, | ||
filename | ||
) { | ||
console.log(event, filename); | ||
transferSass(); | ||
}); |
Oops, something went wrong.