File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
packages/common/templates/configuration/babelrc Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,30 @@ const config: ConfigurationFile = {
4040 }
4141
4242 if ( template === 'vue - cli ') {
43+ // TODO remove this
44+ /**
45+ * This hacky fix got added for vue cli templates that are v3, but don't have a config.
46+ *
47+ * We correctly detect v3 templates, so start using babel 7, but they don't work with the old version of babel config. We need to create a new one.
48+ *
49+ * Need to fix this ASAP and make vue-cli 3 a separate template.
50+ */
51+ try {
52+ const packageJSON = resolveModule ( '/ package . json ') ;
53+ const parsed = JSON . parse ( packageJSON . code ) ;
54+
55+ if (
56+ parsed . devDependencies &&
57+ parsed . devDependencies [ '@vue/cli-plugin-babel' ]
58+ ) {
59+ return JSON . stringify ( {
60+ presets : [ '@vue/app' ] ,
61+ } ) ;
62+ }
63+ } catch ( e ) {
64+ console . error ( e ) ;
65+ }
66+
4367 return JSON . stringify (
4468 {
4569 presets : [
You can’t perform that action at this time.
0 commit comments