@weapp-tailwindcss/cli 0.0.0-alpha.2 → 0.0.0-alpha.3

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/dist/index.cjs CHANGED
@@ -242,6 +242,14 @@ function createBuilder(options) {
242
242
  watchOptions
243
243
  });
244
244
  const tasks = [...getJsTasks(), ...getJsonTasks(), ...getCssTasks(), ...getHtmlTasks(), copyOthers];
245
+ async function runTasks() {
246
+ for (const task of tasks) {
247
+ const s = task();
248
+ if (s) {
249
+ await new Promise((resolve, reject) => s.on("finish", resolve).on("error", reject));
250
+ }
251
+ }
252
+ }
245
253
  return {
246
254
  watcher: void 0,
247
255
  async build() {
@@ -251,17 +259,19 @@ function createBuilder(options) {
251
259
  await deleteAsync(patterns, { cwd, ignore: defaultNodeModulesDirs });
252
260
  }
253
261
  fs.ensureDirSync(path__default.resolve(cwd, outDir));
254
- for (const task of tasks) {
255
- const s = task();
256
- if (s) {
257
- await new Promise((resolve, reject) => s.on("finish", resolve).on("error", reject));
258
- }
259
- }
262
+ await runTasks();
260
263
  return this;
261
264
  },
262
265
  watch() {
263
266
  fs.ensureDirSync(path__default.resolve(cwd, outDir));
264
- const watcher = gulp__default.watch([...globsSet], watchOptions, gulp__default.parallel(...tasks));
267
+ const watcher = gulp__default.watch([...globsSet], watchOptions, async (cb) => {
268
+ try {
269
+ await runTasks();
270
+ cb();
271
+ } catch (error) {
272
+ cb(error);
273
+ }
274
+ });
265
275
  watcher.on("change", function(path2) {
266
276
  console.log(`File ${path2} was changed`);
267
277
  });
package/dist/index.mjs CHANGED
@@ -233,6 +233,14 @@ function createBuilder(options) {
233
233
  watchOptions
234
234
  });
235
235
  const tasks = [...getJsTasks(), ...getJsonTasks(), ...getCssTasks(), ...getHtmlTasks(), copyOthers];
236
+ async function runTasks() {
237
+ for (const task of tasks) {
238
+ const s = task();
239
+ if (s) {
240
+ await new Promise((resolve, reject) => s.on("finish", resolve).on("error", reject));
241
+ }
242
+ }
243
+ }
236
244
  return {
237
245
  watcher: void 0,
238
246
  async build() {
@@ -242,17 +250,19 @@ function createBuilder(options) {
242
250
  await deleteAsync(patterns, { cwd, ignore: defaultNodeModulesDirs });
243
251
  }
244
252
  ensureDirSync(path.resolve(cwd, outDir));
245
- for (const task of tasks) {
246
- const s = task();
247
- if (s) {
248
- await new Promise((resolve, reject) => s.on("finish", resolve).on("error", reject));
249
- }
250
- }
253
+ await runTasks();
251
254
  return this;
252
255
  },
253
256
  watch() {
254
257
  ensureDirSync(path.resolve(cwd, outDir));
255
- const watcher = gulp.watch([...globsSet], watchOptions, gulp.parallel(...tasks));
258
+ const watcher = gulp.watch([...globsSet], watchOptions, async (cb) => {
259
+ try {
260
+ await runTasks();
261
+ cb();
262
+ } catch (error) {
263
+ cb(error);
264
+ }
265
+ });
256
266
  watcher.on("change", function(path2) {
257
267
  console.log(`File ${path2} was changed`);
258
268
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weapp-tailwindcss/cli",
3
- "version": "0.0.0-alpha.2",
3
+ "version": "0.0.0-alpha.3",
4
4
  "description": "The cli of weapp-tailwindcss",
5
5
  "keywords": [],
6
6
  "author": "",
@@ -29,7 +29,7 @@
29
29
  "gulp-less": "^5.0.0",
30
30
  "gulp-sass": "^5.1.0",
31
31
  "postcss-load-config": "^5.0.3",
32
- "weapp-tailwindcss": "3.2.0-alpha.1"
32
+ "weapp-tailwindcss": "3.2.0-alpha.3"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/fs-extra": "^11.0.4",