Unverified Commit 40cf9313 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Remove unused options from swc-loader (#29907)



Since this is not a swcrc option and will be removed in the future it's best to prune it from next-swc already.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
parent 6f3c3387
...@@ -23,20 +23,10 @@ async function transform(src, options) { ...@@ -23,20 +23,10 @@ async function transform(src, options) {
options.jsc.parser.syntax = options.jsc.parser.syntax ?? 'ecmascript' options.jsc.parser.syntax = options.jsc.parser.syntax ?? 'ecmascript'
} }
const { plugin, ...newOptions } = options
if (plugin) {
const m =
typeof src === 'string'
? await this.parse(src, options?.jsc?.parser)
: src
return this.transform(plugin(m), newOptions)
}
return bindings.transform( return bindings.transform(
isModule ? JSON.stringify(src) : src, isModule ? JSON.stringify(src) : src,
isModule, isModule,
toBuffer(newOptions) toBuffer(options)
) )
} }
...@@ -48,18 +38,10 @@ function transformSync(src, options) { ...@@ -48,18 +38,10 @@ function transformSync(src, options) {
options.jsc.parser.syntax = options.jsc.parser.syntax ?? 'ecmascript' options.jsc.parser.syntax = options.jsc.parser.syntax ?? 'ecmascript'
} }
const { plugin, ...newOptions } = options
if (plugin) {
const m =
typeof src === 'string' ? this.parseSync(src, options?.jsc?.parser) : src
return this.transformSync(plugin(m), newOptions)
}
return bindings.transformSync( return bindings.transformSync(
isModule ? JSON.stringify(src) : src, isModule ? JSON.stringify(src) : src,
isModule, isModule,
toBuffer(newOptions) toBuffer(options)
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment