diff --git a/test/e2e/app-dir/actions-tree-shaking/app/actions.js b/test/e2e/app-dir/actions-tree-shaking/app/actions.js new file mode 100644 index 0000000000000..7ced6f46adba1 --- /dev/null +++ b/test/e2e/app-dir/actions-tree-shaking/app/actions.js @@ -0,0 +1,9 @@ +'use server' + +export async function action() { + return 'hello' +} + +export async function unusedExportedAction() { + return 'unused-exported-action' +} diff --git a/test/e2e/app-dir/actions-tree-shaking/app/layout.js b/test/e2e/app-dir/actions-tree-shaking/app/layout.js new file mode 100644 index 0000000000000..750eb927b1980 --- /dev/null +++ b/test/e2e/app-dir/actions-tree-shaking/app/layout.js @@ -0,0 +1,7 @@ +export default function Layout({ children }) { + return ( + + {children} + + ) +} diff --git a/test/e2e/app-dir/actions-tree-shaking/app/page.js b/test/e2e/app-dir/actions-tree-shaking/app/page.js new file mode 100644 index 0000000000000..0ab64d90816c7 --- /dev/null +++ b/test/e2e/app-dir/actions-tree-shaking/app/page.js @@ -0,0 +1,21 @@ +'use client' + +import { useState } from 'react' +import { action } from './actions' + +export default function Page() { + const [text, setText] = useState('initial') + return ( +
+ + {text} +
+ ) +}