Skip to content

Commit a905cb1

Browse files
fix for nextjs app
1 parent e6ed93d commit a905cb1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/devextreme-cli/src/applications/application.nextjs.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ const isNextJsApp = () => {
3030
return fs.existsSync(path.join(appPath, 'next.config.ts')) || fs.existsSync(path.join(appPath, 'next.config.mjs'));
3131
};
3232

33-
const isTsApp = () => {
34-
const appPath = process.cwd();
33+
const isTsApp = (appPath) => {
3534
return fs.existsSync(path.join(appPath, 'next.config.ts'));
3635
};
3736

@@ -133,7 +132,7 @@ const addTemplate = (appPath, appName, templateOptions) => {
133132
};
134133

135134
const getEntryFilePath = (options, appPath) => {
136-
const extension = options.isTypeScript || isTsApp() ? 'ts' : 'js';
135+
const extension = options.isTypeScript || isTsApp(appPath) ? 'ts' : 'js';
137136
const srcFolder = fs.existsSync(path.join(appPath, 'src')) ? 'src' : '';
138137
const isAppRouterApp = fs.existsSync(path.join(appPath, srcFolder, 'app')) && fs.lstatSync(appPath).isDirectory();
139138

0 commit comments

Comments
 (0)