Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(terser): __filename not defined #1367

Merged
merged 2 commits into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/packages/babel/ @Andarist
/packages/image/ @tjenkinson
/packages/node-resolve/ @tjenkinson
/packages/terser/ @tada5hi
tada5hi marked this conversation as resolved.
Show resolved Hide resolved
10 changes: 7 additions & 3 deletions packages/terser/src/module.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { fileURLToPath } from 'url';

import type { NormalizedOutputOptions, RenderedChunk } from 'rollup';
import { hasOwnProperty, isObject, merge } from 'smob';

import type { Options } from './type';
import { WorkerPool } from './worker-pool';

export default function terser(options: Options = {}) {
export default function terser(input: Options = {}) {
const { maxWorkers, ...options } = input;
tada5hi marked this conversation as resolved.
Show resolved Hide resolved

const workerPool = new WorkerPool({
filePath: __filename,
maxWorkers: options.maxWorkers
filePath: fileURLToPath(import.meta.url),
maxWorkers
});

return {
Expand Down
3 changes: 2 additions & 1 deletion packages/terser/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "types/**/*"],
"compilerOptions": {
"noUnusedParameters": false
"noUnusedParameters": false,
"module": "ESNext"
}
}