Skip to content
Snippets Groups Projects
Verified Commit eeaa76ed authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3504265 by finnsky, ksenzee, smustgrave: Yarn watch task broken

(cherry picked from commit c8f23239)
parent f86f182a
No related branches found
No related tags found
12 merge requests!12079Issue #3523476 by matthiasm11: Add empty check on operator,!12024Fix: DocBlock comment for return value of Drupal\Core\Database\Connection::transactionManager(),!11974Draft: Issue #3495165 by catch, joeyroth, berdir, texas-bronius: Better warning...,!11934Issue #3520997: DefaultLazyPluginCollection unnecessarily instantiates plugins when sorting collection,!11887Issue #3520065: The migrate Row class API is incomplete,!11636Draft: Issue #3515643 by macsim: fieldNameExists method is inconsistent,!11515Issue #3480419 by mondrake, smustgrave, catch: Method...,!11380Issue #3490698 by catch, spokje: Bump MINIMUM_STABILITY back to 'stable' when...,!11281Use Drupal Core Leadership terminology in MAINTAINERS.txt,!11239Issue #3507548: Allow workspace changes listing to show all items, without a pager,!11238Fix issue #3051797,!11213Issue #3506743 by tomislav.matokovic: Increasing the color contrast for the navigation block title against the background of the navigation sidebar to at least 4.5:1
Pipeline #421165 canceled
......@@ -9,19 +9,18 @@
'use strict';
const fs = require('node:fs');
const path = require('node:path');
const chokidar = require('chokidar');
const { watch } = require('chokidar');
const { stat, unlink } = require('node:fs');
const changeOrAdded = require('./changeOrAdded');
const log = require('./log');
// Match only on .pcss.css files.
const fileMatch = './**/*.pcss.css';
// Ignore everything in node_modules
const watcher = chokidar.watch(fileMatch, {
// Initialize watcher.
const watcher = watch(['./themes', './modules', './profiles'], {
ignoreInitial: true,
ignored: './node_modules/**'
ignored: (filePath, stats) =>
stats?.isFile() && !filePath.endsWith('.pcss.css') || filePath.includes('node_modules'),
usePolling: true,
});
const unlinkHandler = (err) => {
......@@ -36,8 +35,10 @@ watcher
.on('change', changeOrAdded)
.on('unlink', (filePath) => {
const fileName = filePath.slice(0, -9);
fs.stat(`${fileName}.css`, () => {
fs.unlink(`${fileName}.css`, unlinkHandler);
stat(`${fileName}.css`, (err) => {
if (!err) {
unlink(`${fileName}.css`, unlinkHandler);
}
});
})
.on('ready', () => log(`Watching '${fileMatch}' for changes.`));
.on('ready', () => log(`Watching '**/*.pcss.css' for changes.`));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment