Skip to content

Commit 91f7ebc

Browse files
authored
Add viewport to Next.js config allowExportNames (#89)
1 parent 5bf46bf commit 91f7ebc

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export const configs = {
3939
"runtime",
4040
"preferredRegion",
4141
"maxDuration",
42+
"viewport",
4243
],
4344
},
4445
],

src/only-export-components.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ const valid = [
169169
code: "export const loader = () => {}; export const meta = { title: 'Home' };",
170170
options: [{ allowExportNames: ["loader", "meta"] }],
171171
},
172+
{
173+
name: "Component and viewport export for Next.js",
174+
code: "export const viewport = { width: 'device-width', initialScale: 1 }; export const Page = () => {};",
175+
options: [{ allowExportNames: ["viewport"] }],
176+
},
172177
{
173178
name: "Export as default",
174179
code: "export { App as default }; const App = () => <>Test</>;",

0 commit comments

Comments
 (0)