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() {
2727 preactPreset . registerTranspiler ( module => / \. j s x ? $ / . test ( module . path ) , [
2828 {
2929 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+ } ,
3069 } ,
3170 ] ) ;
3271
Original file line number Diff line number Diff line change @@ -13,5 +13,6 @@ export default new Template(
1313 extraConfigurations : {
1414 '/.babelrc' : configurations . babelrc ,
1515 } ,
16+ defaultOpenedFile : [ '/src/app.js' ] ,
1617 }
1718) ;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export type Options = {
2222 main ?: boolean ;
2323 backgroundColor ?: ( ) => string ;
2424 mainFile ?: string [ ] ;
25+ defaultOpenedFile ?: string [ ] ;
2526} ;
2627
2728export type ConfigurationFiles = {
@@ -96,6 +97,7 @@ export default class Template {
9697 showCube : boolean ;
9798 isServer : boolean ;
9899 mainFile : undefined | string [ ] ;
100+ defaultOpenedFile : string [ ] ;
99101
100102 constructor (
101103 name : TemplateType ,
@@ -131,6 +133,7 @@ export default class Template {
131133 this . backgroundColor = options . backgroundColor ;
132134
133135 this . showCube = options . showCube != null ? options . showCube : true ;
136+ this . defaultOpenedFile = options . defaultOpenedFile || [ ] ;
134137 }
135138
136139 // eslint-disable-next-line
@@ -184,7 +187,7 @@ export default class Template {
184187 getDefaultOpenedFiles (
185188 configurationFiles : ParsedConfigurationFiles
186189 ) : string [ ] {
187- return this . getEntries ( configurationFiles ) ;
190+ return [ ... this . defaultOpenedFile , ... this . getEntries ( configurationFiles ) ] ;
188191 }
189192
190193 /**
You can’t perform that action at this time.
0 commit comments