Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/base.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ const basePath = process.cwd();
const srcPath = path.join(basePath, 'src');
const testPath = path.join(basePath, 'tests');
const allPaths = [srcPath, testPath];
const mainEntryPath = path.join(srcPath, 'main.ts');

const isTsx = existsSync(path.join(srcPath, 'main.tsx'));
const mainEntryPath = path.join(srcPath, isTsx ? 'main.tsx' : 'main.ts');
const mainCssPath = path.join(srcPath, 'main.css');
const indexHtmlPattern = /src\/index\.html$/;

export const mainEntry = 'main';
Expand Down Expand Up @@ -273,7 +276,7 @@ export default function webpackConfigFactory(args: any): WebpackConfiguration {
entry: {
[mainEntry]: removeEmpty([
'@dojo/webpack-contrib/build-time-render/hasBuildTimeRender',
path.join(srcPath, 'main.css'),
existsSync(mainCssPath) ? mainCssPath : null,
mainEntryPath
])
},
Expand Down