swc icon indicating copy to clipboard operation
swc copied to clipboard

`Config.script` not work

Open wavesheep opened this issue 3 years ago • 2 comments

Describe the bug In type definition, option has a script field https://github.com/swc-project/swc/blob/308792dc90eefda5476a41a996a210c39e6f1a79/node-swc/src/types.ts#L19-L22 but when i use this field

{
    jsc: {
      target: 'es5',
    },
    sourceMaps: true,
    script: true
  }

Error occurs

Error: Argument at `2` is not JsBuffer

Caused by:
    unknown field `script` at line 1 column 79

Version The version of @swc/core: 1.2.54

wavesheep avatar Apr 24 '21 13:04 wavesheep

By the way, I want to know what configuration should I use when to transform a script instead of module

wavesheep avatar Apr 24 '21 13:04 wavesheep

Same question. I turned into use isModule: false

shrinktofit avatar Aug 11 '21 08:08 shrinktofit