File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed
app/src/sandbox/eval/presets/preact-cli Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,45 @@ export default function initialize() {
27
27
preactPreset . registerTranspiler ( module => / \. j s x ? $ / . test ( module . path ) , [
28
28
{
29
29
transpiler : babelTranspiler ,
30
+ options : {
31
+ isV7 : false ,
32
+ compileNodeModulesWithEnv : true ,
33
+ config : {
34
+ presets : [
35
+ [
36
+ 'env' ,
37
+ {
38
+ loose : true ,
39
+ uglify : true ,
40
+ modules : false ,
41
+ exclude : [
42
+ 'transform-regenerator' ,
43
+ 'transform-es2015-typeof-symbol' ,
44
+ ] ,
45
+ } ,
46
+ ] ,
47
+ ] ,
48
+
49
+ plugins : [
50
+ 'babel-plugin-syntax-dynamic-import' ,
51
+ 'babel-plugin-transform-object-assign' ,
52
+ 'babel-plugin-transform-decorators-legacy' ,
53
+ 'babel-plugin-transform-class-properties' ,
54
+ 'babel-plugin-transform-export-extensions' ,
55
+ 'babel-plugin-transform-object-rest-spread' ,
56
+ 'babel-plugin-transform-react-constant-elements' ,
57
+ [ 'babel-plugin-transform-react-jsx' , { pragma : 'h' } ] ,
58
+ [
59
+ 'babel-plugin-jsx-pragmatic' ,
60
+ {
61
+ module : 'preact' ,
62
+ export : 'h' ,
63
+ import : 'h' ,
64
+ } ,
65
+ ] ,
66
+ ] ,
67
+ } ,
68
+ } ,
30
69
} ,
31
70
] ) ;
32
71
Original file line number Diff line number Diff line change @@ -13,5 +13,6 @@ export default new Template(
13
13
extraConfigurations : {
14
14
'/.babelrc' : configurations . babelrc ,
15
15
} ,
16
+ defaultOpenedFile : [ '/src/app.js' ] ,
16
17
}
17
18
) ;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export type Options = {
22
22
main ?: boolean ;
23
23
backgroundColor ?: ( ) => string ;
24
24
mainFile ?: string [ ] ;
25
+ defaultOpenedFile ?: string [ ] ;
25
26
} ;
26
27
27
28
export type ConfigurationFiles = {
@@ -96,6 +97,7 @@ export default class Template {
96
97
showCube : boolean ;
97
98
isServer : boolean ;
98
99
mainFile : undefined | string [ ] ;
100
+ defaultOpenedFile : string [ ] ;
99
101
100
102
constructor (
101
103
name : TemplateType ,
@@ -131,6 +133,7 @@ export default class Template {
131
133
this . backgroundColor = options . backgroundColor ;
132
134
133
135
this . showCube = options . showCube != null ? options . showCube : true ;
136
+ this . defaultOpenedFile = options . defaultOpenedFile || [ ] ;
134
137
}
135
138
136
139
// eslint-disable-next-line
@@ -184,7 +187,7 @@ export default class Template {
184
187
getDefaultOpenedFiles (
185
188
configurationFiles : ParsedConfigurationFiles
186
189
) : string [ ] {
187
- return this . getEntries ( configurationFiles ) ;
190
+ return [ ... this . defaultOpenedFile , ... this . getEntries ( configurationFiles ) ] ;
188
191
}
189
192
190
193
/**
You can’t perform that action at this time.
0 commit comments