@@ -19,16 +19,16 @@ module.exports = {
19
19
return '' ;
20
20
} ,
21
21
22
- // Borrowed from ember-cli-babel
23
- _emberVersionRequiresModulesAPIPolyfill ( ) {
24
- let checker = this . checker . for ( 'ember-source' , 'npm' ) ;
22
+ // Borrowed from ember-cli-babel
23
+ _emberVersionRequiresModulesAPIPolyfill ( ) {
24
+ let checker = this . checker . for ( 'ember-source' , 'npm' ) ;
25
25
26
- if ( ! checker . exists ( ) ) {
27
- return true ;
28
- }
26
+ if ( ! checker . exists ( ) ) {
27
+ return true ;
28
+ }
29
29
30
- return checker . lt ( '3.27.0-alpha.1' ) ;
31
- } ,
30
+ return checker . lt ( '3.27.0-alpha.1' ) ;
31
+ } ,
32
32
33
33
treeForAddon ( tree ) {
34
34
let babel = this . addons . find ( ( addon ) => addon . name === 'ember-cli-babel' ) ;
@@ -41,38 +41,34 @@ module.exports = {
41
41
destDir : '@html-next/vertical-collection'
42
42
} ) ;
43
43
44
- // When compiling with `compileModules: false`, ember-cli-babel defaults to
45
- // using the modules polyfill, since it assumes we are concatenating the
46
- // output script using `app.import` without an AMD wrapper.
47
- //
48
- // This does not apply to us, since we are compiling the `-private` modules
49
- // into a single AMD module (via rollup below), which can in fact have
50
- // external dependencies.
51
- //
52
- // We can opt-out of this with `disableEmberModulesAPIPolyfill: true`. In
53
- // Ember versions with "real modules", that is what we want in order to
54
- // avoid the Ember global deprecation (or just completely not working in
55
- // 4.0+).
56
- //
57
- // It seems like the intent may have been that we should be able to set
58
- // this to `true` unconditionally, and `ember-cli-babel` will ignore this
59
- // setting if the Ember verion requires the modules API polyfill. However,
60
- // presumably due to a bug, ember-cli-babel actually checks for this value
61
- // first and return out of the function early if its value is truthy. This
62
- // means that if we set this to true unconditionally, then we would have
63
- // disabled the modules polyfill for Ember versions that needs it, which
64
- // would be incorrect. Therefore, we have to duplicate the detection logic
65
- // here in order to set this value appropriately.
66
- //
67
- // Ideally, we should just stop trying to rollup the -private modules and
68
- // let the modern build pipeline optimizes things for us, then none of this
69
- // would have been necessary.
70
44
let privateTree = babel . transpileTree ( withPrivate , {
71
45
babel : this . options . babel ,
72
46
'ember-cli-babel' : {
47
+ // we leave our output as valid ES
48
+ // for the consuming app's config to transpile as desired
49
+ // so we don't want to compileModules to amd here
73
50
compileModules : false ,
74
- disableEmberModulesAPIPolyfill :
75
- ! this . _emberVersionRequiresModulesAPIPolyfill ( ) ,
51
+
52
+ disableEmberModulesAPIPolyfill : ! this . _emberVersionRequiresModulesAPIPolyfill ( ) ,
53
+
54
+ // TODO for the embroider world we want to leave our -private module
55
+ // as an es module and only transpile the few things we genuinely care about.
56
+ // ideally this would occur as a pre-publish step so that consuming apps would
57
+ // just see a `-private.js` file and not pay any additional costs.
58
+ // CURRENTLY we transpile the -private module fully acccording to the
59
+ // consuming app's config, so we must leave these enabled.
60
+ disablePresetEnv : false ,
61
+ disableDebugTooling : false ,
62
+ disableDecoratorTransforms : false ,
63
+ enableTypeScriptTransform : true ,
64
+
65
+ throwUnlessParallelizable : true ,
66
+
67
+ // consuming app will take care of this if needed,
68
+ // we don't need to also include
69
+ includePolyfill : false ,
70
+
71
+ extensions : [ 'js' , 'ts' ] ,
76
72
} ,
77
73
} ) ;
78
74
0 commit comments