-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fixed the npm script and added css build file
- Loading branch information
1 parent
79f8211
commit 4a8f2c5
Showing
5 changed files
with
363 additions
and
104 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"prettier.eslintIntegration": true | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true | ||
} |
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,41 @@ | ||
const fs = require('fs') | ||
const path = require('path') | ||
const {spawn} = require('child_process') | ||
|
||
const args = process.argv.slice(2) | ||
fs.readdir(path.join(__dirname, '../src/themes'), (err, files) => { | ||
if (err) { | ||
console.log('err', err) | ||
return | ||
} | ||
files.map(async (file) => { | ||
if (/\.styl/g.test(file)) { | ||
var stylusCMD; | ||
const stylusBin = ['node_modules', 'stylus', 'bin', 'stylus'].join(path.sep) | ||
var cmdargs = [ | ||
stylusBin, | ||
`src/themes/${file}`, | ||
'-u', | ||
'autoprefixer-stylus' | ||
] | ||
cmdargs = cmdargs.concat(args) | ||
|
||
stylusCMD = spawn('node', cmdargs, { shell: true }) | ||
|
||
stylusCMD.stdout.on('data', (data) => { | ||
console.log(`[Stylus Build ] stdout: ${data}`); | ||
}); | ||
|
||
stylusCMD.stderr.on('data', (data) => { | ||
console.error(`[Stylus Build ] stderr: ${data}`); | ||
}); | ||
|
||
stylusCMD.on('close', (code) => { | ||
console.log(`[Stylus Build ] child process exited with code ${code}`); | ||
}); | ||
} else { | ||
return | ||
} | ||
|
||
}) | ||
}) |
Oops, something went wrong.