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 all 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
@@ -0,0 +1,2 @@
'use client';
foo(() => { })
@@ -0,0 +1,2 @@
'use client';
foo(()=>{});
@@ -0,0 +1,2 @@
"use client";
foo(function() {});
@@ -0,0 +1,2 @@
"use client";
foo(function() {});
@@ -0,0 +1,6 @@
'use client';


export class Foo {
foo() { }
}
@@ -0,0 +1,4 @@
'use client';
export class Foo {
foo() {}
}
@@ -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;
}();
@@ -0,0 +1,6 @@
'use client';


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