coralite-scripts 0.0.3 → 0.16.0
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/bin/index.js +21 -1
- package/package.json +2 -2
package/bin/index.js
CHANGED
|
@@ -150,6 +150,26 @@ const watcher = chokidar.watch(watchPath, {
|
|
|
150
150
|
persistent: true
|
|
151
151
|
})
|
|
152
152
|
|
|
153
|
+
let initWatcher = true
|
|
154
|
+
|
|
155
|
+
if (config.sass) {
|
|
156
|
+
(async () => {
|
|
157
|
+
const start = process.hrtime()
|
|
158
|
+
let duration, dash = colours.gray(' ─ ')
|
|
159
|
+
|
|
160
|
+
process.stdout.write(toTime() + colours.bgYellow('Compiling SASS...') + '\n')
|
|
161
|
+
// rebuild CSS and send notification
|
|
162
|
+
await buildSass({
|
|
163
|
+
...config.sass,
|
|
164
|
+
output: join(config.output, 'css')
|
|
165
|
+
})
|
|
166
|
+
initWatcher = false
|
|
167
|
+
// prints time and path to the file that has been changed or added.
|
|
168
|
+
duration = process.hrtime(start)
|
|
169
|
+
process.stdout.write(toTime() + colours.bgGreen('Compiled SASS') + dash + toMS(duration) + dash + '\n')
|
|
170
|
+
})()
|
|
171
|
+
}
|
|
172
|
+
|
|
153
173
|
watcher
|
|
154
174
|
.on('change', async (path) => {
|
|
155
175
|
const start = process.hrtime()
|
|
@@ -175,7 +195,7 @@ watcher
|
|
|
175
195
|
})
|
|
176
196
|
})
|
|
177
197
|
.on('add', async (path) => {
|
|
178
|
-
if (path.endsWith('.scss') || path.endsWith('.sass')) {
|
|
198
|
+
if (!initWatcher && (path.endsWith('.scss') || path.endsWith('.sass'))) {
|
|
179
199
|
const start = process.hrtime()
|
|
180
200
|
let duration, dash = colours.gray(' ─ ')
|
|
181
201
|
// rebuild CSS and send notification
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coralite-scripts",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Configuration and scripts for Create Coralite.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"license": "AGPL-3.0-only",
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"chokidar": "^4.0.3",
|
|
44
|
-
"coralite": "^0.
|
|
44
|
+
"coralite": "^0.16.0",
|
|
45
45
|
"express": "^5.1.0",
|
|
46
46
|
"html-validate": "^10.0.0",
|
|
47
47
|
"kleur": "^4.1.5",
|