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

swcx (pure rust CLI) doesn't accept --config #5172

Closed
alexeagle opened this issue Jul 11, 2022 · 2 comments
Closed

swcx (pure rust CLI) doesn't accept --config #5172

alexeagle opened this issue Jul 11, 2022 · 2 comments
Labels

Comments

@alexeagle
Copy link
Contributor

Describe the bug

It seems the --config flag doesn't work under the rust CLI like it does for the Node.js CLI.

Input code

export const a = "a";

Config

{}

Playground link

No response

Expected behavior

The --config flag works with the Node.js CLI, so it should work with the rust CLI as well

Actual behavior

--config seems to be ignored

Version

1.2.211

Additional context

repro:

$ wget https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.2.211.tgz
$ tar -xzvf core-linux-x64-gnu-1.2.211.tgz
$ chmod u+x package/swc
$ echo 'export const a = "a";' > in.ts
$ echo '{}' > .swcrc
$ ./package/swc compile in.ts --config 'module.type=commonjs'
in.ts
export var a = "a";

however if the .swcrc file has the config, then you get the correct result:

$ jq --null-input '.module.type="commonjs"' > .swcrc
$ ./package/swc compile --config-file .swcrc in.ts
in.ts
"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "a", {
    enumerable: true,
    get: function() {
        return a;
    }
});
var a = "a"; 
@kdy1 kdy1 added this to the Planned milestone Jul 11, 2022
@kwonoj
Copy link
Member

kwonoj commented Jul 11, 2022

This one's dupe of #4017 , you can see 'config' is not makred as implemented. For missing features, we are using those single tracking issue.

@kwonoj kwonoj closed this as completed Jul 11, 2022
@kdy1 kdy1 removed this from the Planned milestone Jul 11, 2022
@swc-bot
Copy link
Collaborator

swc-bot commented Oct 16, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

4 participants