File tree Expand file tree Collapse file tree 1 file changed +51
-29
lines changed
packages/common/src/templates/configuration/babelrc Expand file tree Collapse file tree 1 file changed +51
-29
lines changed Original file line number Diff line number Diff line change @@ -142,37 +142,59 @@ const config: ConfigurationFile = {
142142 }
143143
144144 if ( template === 'cxjs' ) {
145- return JSON . stringify (
146- {
147- presets : [
148- [
149- 'env' ,
150- {
151- targets : {
152- chrome : 50 ,
153- ie : 11 ,
154- ff : 30 ,
155- edge : 12 ,
156- safari : 9 ,
145+ if ( isV7 ) {
146+ return JSON . stringify (
147+ {
148+ presets : [ 'env' ] ,
149+ plugins : [
150+ '@babel/plugin-proposal-class-properties' ,
151+ '@babel/plugin-proposal-object-rest-spread' ,
152+ '@babel/plugin-proposal-function-bind' ,
153+ 'transform-cx-jsx' ,
154+ '@babel/plugin-transform-parameters' ,
155+ '@babel/plugin-syntax-dynamic-import' ,
156+ [
157+ '@babel/plugin-transform-react-jsx' ,
158+ { pragma : 'VDOM.createElement' } ,
159+ ] ,
160+ ] ,
161+ } ,
162+ null ,
163+ 2
164+ ) ;
165+ } else {
166+ return JSON . stringify (
167+ {
168+ presets : [
169+ [
170+ 'env' ,
171+ {
172+ targets : {
173+ chrome : 50 ,
174+ ie : 11 ,
175+ ff : 30 ,
176+ edge : 12 ,
177+ safari : 9 ,
178+ } ,
179+ modules : false ,
180+ loose : true ,
181+ useBuiltIns : true ,
157182 } ,
158- modules : false ,
159- loose : true ,
160- useBuiltIns : true ,
161- } ,
183+ ] ,
184+ 'stage-2' ,
162185 ] ,
163- 'stage-2' ,
164- ] ,
165- plugins : [
166- [ 'transform-cx-jsx' ] ,
167- [ 'transform-react-jsx' , { pragma : 'VDOM.createElement' } ] ,
168- 'transform-function-bind' ,
169- 'transform-runtime' ,
170- 'transform-regenerator' ,
171- ] ,
172- } ,
173- null ,
174- 2
175- ) ;
186+ plugins : [
187+ [ 'transform-cx-jsx' ] ,
188+ [ 'transform-react-jsx' , { pragma : 'VDOM.createElement' } ] ,
189+ 'transform-function-bind' ,
190+ 'transform-runtime' ,
191+ 'transform-regenerator' ,
192+ ] ,
193+ } ,
194+ null ,
195+ 2
196+ ) ;
197+ }
176198 }
177199
178200 return JSON . stringify ( { presets : [ ] , plugins : [ ] } , null , 2 ) ;
You can’t perform that action at this time.
0 commit comments