Skip to content

Commit 1765f54

Browse files
nicknisiCompuIves
authored andcommitted
fix support for TSX in Dojo template (codesandbox#1260)
- Add /tsconfig.json as a configuration to the Dojo template - Add a default tsconfig option for Dojo template
1 parent ea0bae1 commit 1765f54

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

packages/common/templates/configuration/tsconfig/index.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,37 @@ const config: ConfigurationFile = {
117117
);
118118
}
119119

120+
if (template === '@dojo/cli-create-app') {
121+
return JSON.stringify(
122+
{
123+
compilerOptions: {
124+
declaration: false,
125+
experimentalDecorators: true,
126+
jsx: 'react',
127+
jsxFactory: 'tsx',
128+
lib: [
129+
'dom',
130+
'es5',
131+
'es2015.promise',
132+
'es2015.iterable',
133+
'es2015.symbol',
134+
'es2015.symbol.wellknown'
135+
],
136+
module: 'commonjs',
137+
moduleResolution: 'node',
138+
noUnusedLocals: true,
139+
outDir: '_build/',
140+
removeComments: false,
141+
importHelpers: true,
142+
downLevelIteration: true,
143+
sourceMap: true,
144+
strict: true,
145+
target: 'es5'
146+
}
147+
}
148+
);
149+
}
150+
120151
return JSON.stringify(
121152
{
122153
compilerOptions: {

packages/common/templates/dojo.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import Template from './template';
44
import { decorateSelector } from '../theme';
5+
import configurations from './configuration';
56

67
export class DojoTemplate extends Template {
78
// eslint-disable-next-line no-unused-vars
@@ -28,5 +29,8 @@ export default new DojoTemplate(
2829
showOnHomePage: true,
2930
showCube: false,
3031
isTypescript: true,
32+
extraConfigurations: {
33+
'/tsconfig.json': configurations.tsconfig
34+
},
3135
}
3236
);

0 commit comments

Comments
 (0)