diff options
author | 2021-12-31 17:52:38 -0800 | |
---|---|---|
committer | 2021-12-31 17:52:38 -0800 | |
commit | d068d80ab930b8357f09a3f57cdf014563f4a8d5 (patch) | |
tree | 98617ba3044070368617be4a5fd73e300641fa5f /src/css_scanner.zig | |
parent | eb142a6be556abd209a37efb5c9e9864de6e963b (diff) | |
download | bun-d068d80ab930b8357f09a3f57cdf014563f4a8d5.tar.gz bun-d068d80ab930b8357f09a3f57cdf014563f4a8d5.tar.zst bun-d068d80ab930b8357f09a3f57cdf014563f4a8d5.zip |
Attempt to fix watcher issue with repl.it
Diffstat (limited to 'src/css_scanner.zig')
-rw-r--r-- | src/css_scanner.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/css_scanner.zig b/src/css_scanner.zig index aa5062cbb..10f065058 100644 --- a/src/css_scanner.zig +++ b/src/css_scanner.zig @@ -1206,7 +1206,7 @@ pub fn NewBundler( while (this.import_queue.readItem()) |item| { const watcher_id = this.watcher.indexOf(item) orelse unreachable; const watch_item = this.watcher.watchlist.get(watcher_id); - const source = try this.getSource(watch_item.file_path, watch_item.fd); + const source = try this.getSource(watch_item.file_path, if (watch_item.fd > 0) watch_item.fd else null); css.source = &source; try css.scan(log, allocator, &did_warn_tailwind); } @@ -1230,7 +1230,7 @@ pub fn NewBundler( const item = this.bundle_queue.items[@intCast(usize, i)]; const watcher_id = this.watcher.indexOf(item) orelse unreachable; const watch_item = this.watcher.watchlist.get(watcher_id); - const source = try this.getSource(watch_item.file_path, watch_item.fd); + const source = try this.getSource(watch_item.file_path, if (watch_item.fd > 0) watch_item.fd else null); css.source = &source; const file_path = fs.relativeTo(watch_item.file_path); if (hot_module_reloading and FeatureFlags.css_supports_fence) { @@ -1255,7 +1255,7 @@ pub fn NewBundler( }; } - pub fn getSource(this: *CSSBundler, url: string, input_fd: StoredFileDescriptorType) !logger.Source { + pub fn getSource(this: *CSSBundler, url: string, input_fd: ?StoredFileDescriptorType) !logger.Source { const entry = try this.fs_reader.readFile(this.fs, url, 0, true, input_fd); const file = Fs.File{ .path = Fs.Path.init(url), .contents = entry.contents }; return logger.Source.initFile(file, this.allocator); |