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

test(es/minifier): Add tests for preserving top-level directives #6545

Merged
merged 4 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use client';
foo(() => { })
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use client';
foo(()=>{});
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"use client";
foo(function() {});
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"use client";
foo(function() {});
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use client';


export class Foo {
foo() { }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use client';
export class Foo {
foo() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"use client";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
import _create_class from "@swc/helpers/src/_create_class.mjs";
export var Foo = /*#__PURE__*/ function() {
"use strict";
function Foo() {
_class_call_check(this, Foo);
}
_create_class(Foo, [
{
key: "foo",
value: function foo() {}
}
]);
return Foo;
}();
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use client';


export var Foo = {
foo() { }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use client';
export var Foo = {
foo () {}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use client";
export var Foo = {
foo: function foo() {}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use client";
export var Foo = {
foo: function() {}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"defaults": true,
"directives": false
}