11import { dispatch , reattach , clearErrorTransformers } from 'codesandbox-api' ;
2+ import { flatten } from 'lodash' ;
23import { absolute } from '@codesandbox/common/lib/utils/path' ;
34import _debug from '@codesandbox/common/lib/utils/debug' ;
45import parseConfigurations from '@codesandbox/common/lib/templates/configuration/parse' ;
@@ -195,7 +196,6 @@ const PREINSTALLED_DEPENDENCIES = [
195196 'babel-plugin-detective' ,
196197 'babel-plugin-transform-prevent-infinite-loops' ,
197198 'babel-plugin-transform-vue-jsx' ,
198- 'babel-plugin-jsx-pragmatic' ,
199199 'flow-bin' ,
200200 ...BABEL_DEPENDENCIES ,
201201] ;
@@ -213,7 +213,7 @@ function getDependencies(parsedPackage, templateDefinition, configurations) {
213213
214214 // Add all babel plugins/presets to whitelisted dependencies
215215 if ( configurations && configurations . babel && configurations . babel . parsed ) {
216- ( configurations . babel . parsed . presets || [ ] )
216+ flatten ( configurations . babel . parsed . presets || [ ] )
217217 . filter ( p => typeof p === 'string' )
218218 . forEach ( p => {
219219 const [ first , ...parts ] = p . split ( '/' ) ;
@@ -225,7 +225,7 @@ function getDependencies(parsedPackage, templateDefinition, configurations) {
225225 foundWhitelistedDevDependencies . push ( prefixedName ) ;
226226 } ) ;
227227
228- ( configurations . babel . parsed . plugins || [ ] )
228+ flatten ( configurations . babel . parsed . plugins || [ ] )
229229 . filter ( p => typeof p === 'string' )
230230 . forEach ( p => {
231231 const [ first , ...parts ] = p . split ( '/' ) ;
0 commit comments