@adamlui/scss-to-css 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/package.json +2 -2
- package/scss-to-css.js +7 -6
package/README.md
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
### Recursively compile all SCSS files into minified CSS.
|
|
4
4
|
|
|
5
|
+
<a href="https://www.npmjs.com/package/@adamlui/scss-to-css"><img height=31 src="https://img.shields.io/npm/dt/%40adamlui%2Fscss-to-css?logo=npm&logoColor=white&labelColor=46464&style=for-the-badge"></a>
|
|
5
6
|
<a href="#%EF%B8%8F-mit-license"><img height=31 src="https://img.shields.io/badge/License-MIT-fcde7b.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
6
|
-
<a href="https://www.npmjs.com/package/@adamlui/scss-to-css"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.3.
|
|
7
|
+
<a href="https://www.npmjs.com/package/@adamlui/scss-to-css?activeTab=versions"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.3.2-fc7811.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
7
8
|
|
|
8
|
-
<img height=8px width="100%" src="https://
|
|
9
|
+
<img height=8px width="100%" src="https://github.com/adamlui/js-utils/blob/main/docs/images/aqua-separator.png">
|
|
9
10
|
|
|
10
11
|
## ⚡ Installation
|
|
11
12
|
|
|
@@ -33,7 +34,7 @@ Sample output:
|
|
|
33
34
|
|
|
34
35
|
<img src="https://github.com/adamlui/js-utils/blob/main/scss-to-css/media/images/sample-output.png">
|
|
35
36
|
|
|
36
|
-
**💡 Note:** Source maps are also generated by default
|
|
37
|
+
**💡 Note:** Source maps are also generated by default unless `--disable-source-maps` is passed.
|
|
37
38
|
|
|
38
39
|
#
|
|
39
40
|
|
|
@@ -44,7 +45,7 @@ scss-to-css <input_path> <output_path>
|
|
|
44
45
|
```
|
|
45
46
|
|
|
46
47
|
- `<input_path>`: Path to SCSS file or directory containing SCSS files to be compiled, relative to the current working directory.
|
|
47
|
-
- `<output_path>`: Path to file or directory where CSS + sourcemap files will be stored, relative to original file location
|
|
48
|
+
- `<output_path>`: Path to file or directory where CSS + sourcemap files will be stored, relative to original file location (if not provided, `css/` is used).
|
|
48
49
|
|
|
49
50
|
**💡 Note:** If folders are passed, files will be processed recursively. To include dotfolders, pass `--include-dotfolders`.
|
|
50
51
|
|
|
@@ -111,7 +112,7 @@ SOFTWARE.
|
|
|
111
112
|
|
|
112
113
|
<br>
|
|
113
114
|
|
|
114
|
-
<img height=6px width="100%" src="https://
|
|
115
|
+
<img height=6px width="100%" src="https://github.com/adamlui/js-utils/blob/main/docs/images/aqua-separator.png">
|
|
115
116
|
|
|
116
117
|
<a href="https://github.com/adamlui/js-utils">**Home**</a> /
|
|
117
118
|
<a href="https://github.com/adamlui/js-utils/discussions">Discuss</a> /
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adamlui/scss-to-css",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Recursively compile all SCSS files into minified CSS",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Adam Lui",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"url": "https://github.com/adamlui/js-utils/issues"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"sass": "^1.71.
|
|
41
|
+
"sass": "^1.71.1"
|
|
42
42
|
},
|
|
43
43
|
"funding": {
|
|
44
44
|
"type": "github",
|
package/scss-to-css.js
CHANGED
|
@@ -13,15 +13,17 @@ const nc = '\x1b[0m', // no color
|
|
|
13
13
|
|
|
14
14
|
// Init I/O args
|
|
15
15
|
const [inputArg = '', outputArg = ''] = ( // default to empty strings for error-less handling
|
|
16
|
-
process.argv.slice(2) // exclude executable and script
|
|
16
|
+
process.argv.slice(2) // exclude executable and script paths
|
|
17
17
|
.filter(arg => !arg.startsWith('-')) // exclude flags
|
|
18
18
|
.map(arg => arg.replace(/^\/*/, '')) // clean leading slashes to avoid parsing system root
|
|
19
19
|
);
|
|
20
20
|
|
|
21
21
|
// Validate input arg (output arg can be anything)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const inputPath = path.resolve(process.cwd(), inputArg);
|
|
23
|
+
if (inputArg && !fs.existsSync(inputPath)) {
|
|
24
|
+
console.error(`\n${br}Error: First arg must be an existing file or directory.`
|
|
25
|
+
+ `\n${ inputPath } does not exist.${nc}`
|
|
26
|
+
+ '\n\nExample valid command: \n>> scss-to-css . output.min.css');
|
|
25
27
|
process.exit(1);
|
|
26
28
|
}
|
|
27
29
|
|
|
@@ -32,8 +34,7 @@ const config = {
|
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
// Recursively find all eligible SCSS files or arg-passed file
|
|
35
|
-
const
|
|
36
|
-
scssFiles = [];
|
|
37
|
+
const scssFiles = [];
|
|
37
38
|
if (inputArg.endsWith('.scss')) scssFiles.push(inputPath);
|
|
38
39
|
else (function findSCSSfiles(dir) {
|
|
39
40
|
const files = fs.readdirSync(dir);
|