Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Bad configuration should prevent compilation attempt #12

Open
duncanbeevers opened this issue Jul 11, 2019 · 1 comment
Open

Bad configuration should prevent compilation attempt #12

duncanbeevers opened this issue Jul 11, 2019 · 1 comment

Comments

@duncanbeevers
Copy link

If the config supplied to swc-loader is invalid, instead of running with defaults swc should warn the operator and halt compilation.

@meshulam
Copy link

meshulam commented Jan 4, 2022

This may no longer be an issue. When I use the following invalid config:

{
  loader: 'swc-loader',
  options: {
    module: {
      type: 'foo',
    },
  },
}

I get the error:

Module build failed (from ../node_modules/swc-loader/src/index.js):
Error: Failed to deserialize swc::config::Options from json string (`{"module":{"type":"foo"},"filename":"/path/to/myfile.js","sourceMaps":true,"sourceFileName":"/path/to/myfile.js"}`)

Caused by:
    unknown variant `foo`, expected one of `commonjs`, `umd`, `amd`, `es6` at line 1 column 175

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants