fix(swc): Change default value of inlineSourcesContent (#2471)

swc:
 - Make `inlineSourcesContent` `true` by default. (#2470)
This commit is contained in:
Donny/강동윤 2021-10-19 15:37:58 +09:00 committed by GitHub
parent c9437d3226
commit ee880d63ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 2 deletions

View File

@ -86,7 +86,7 @@ it("(async) should handle plugin", async () => {
expect(out.code).toBe("");
});
it("(async) should handel dynmic import", async () => {
it("(async) should handle dynamic import", async () => {
const out = await swc.transform("import('foo');", {
jsc: {
target: "es3",

View File

@ -522,7 +522,7 @@ pub struct Config {
#[serde(default)]
pub source_maps: Option<SourceMapsConfig>,
#[serde(default)]
#[serde(default = "true_by_default")]
pub inline_sources_content: bool,
}

View File

@ -9,5 +9,8 @@
"sources": [
"../../input/index.ts"
],
"sourcesContent": [
"import \"./errors.ts\";\n\nfunction a() {\n t();\n}\n\nfunction t(x = false) {\n if (x) {\n throw new Error(\"Hello\");\n }\n t(!0);\n}\n\na();"
],
"version": 3
}

View File

@ -6,5 +6,8 @@
"sources": [
"../../input/index.ts"
],
"sourcesContent": [
"\n\nexport const foo = 1;"
],
"version": 3
}

View File

@ -6,5 +6,8 @@
"sources": [
"../../input/index.js"
],
"sourcesContent": [
"export const foo = () => {\n return 2;\n};"
],
"version": 3
}