File tree Expand file tree Collapse file tree 3 files changed +7
-14
lines changed
turbopack/crates/turbopack-node/js/src Expand file tree Collapse file tree 3 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ declare const __turbopack_external_require__: (
55) => any
66
77import type { Processor } from 'postcss'
8+ import { workerData } from 'worker_threads'
89
910// @ts -ignore
1011import postcss from '@vercel/turbopack/postcss'
@@ -133,8 +134,7 @@ export default async function transform(
133134 }
134135}
135136
136- // @ts -ignore
137- if ( typeof self !== 'undefined' && self . workerData && self . workerData . binding ) {
137+ if ( workerData && workerData . binding ) {
138138 // @ts -ignore
139139 const { run } = require ( '../web_worker/evaluate' )
140140 run ( async ( ) => {
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import {
1717} from './transforms'
1818import fs from 'fs'
1919import path from 'path'
20+ import { workerData } from 'worker_threads'
2021
2122export type IpcInfoMessage =
2223 | {
@@ -509,8 +510,7 @@ const transform = (
509510
510511export { transform as default }
511512
512- // @ts -ignore
513- if ( typeof self !== 'undefined' && self . workerData && self . workerData . binding ) {
513+ if ( workerData && workerData . binding ) {
514514 // @ts -ignore
515515 const { run } = require ( '../web_worker/evaluate' )
516516 run ( async ( ) => {
Original file line number Diff line number Diff line change @@ -6,20 +6,13 @@ import {
66} from '../worker_thread/taskChannel'
77import { structuredError } from '../error'
88import type { Channel } from '../types'
9+ import { workerData , threadId as workerId } from 'worker_threads'
910
10- export type Self = DedicatedWorkerGlobalScope & {
11- workerData : {
12- workerId : number
13- cwd : string
14- binding : Binding
15- }
16- }
11+ export type Self = DedicatedWorkerGlobalScope
1712
1813export declare const self : Self
19- // @ts -ignore
20- const { workerId } = self . workerData
2114
22- let binding : Binding = self . workerData . binding
15+ let binding : Binding = workerData . binding
2316
2417binding . workerCreated ( workerId )
2518
You can’t perform that action at this time.
0 commit comments