File tree Expand file tree Collapse file tree 3 files changed +1048
-89
lines changed Expand file tree Collapse file tree 3 files changed +1048
-89
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
33const { resolve } = require ( 'path' ) ;
4+ const { hasPlugin, addPlugin } = require ( 'ember-cli-babel-plugin-helpers' ) ;
45
56module . exports = {
67 name : require ( './package' ) . name ,
78
89 included ( ) {
910 this . _super . included . apply ( this , arguments ) ;
1011
11- this . patchEmberModulesAPIPolyfill ( ) ;
12+ this . addBabelPlugin ( ) ;
1213 } ,
1314
14- patchEmberModulesAPIPolyfill ( ) {
15- const babel = this . parent . findOwnAddonByName
16- ? this . parent . findOwnAddonByName ( 'ember-cli-babel' ) // parent is an addon
17- : this . parent . findAddonByName ( 'ember-cli-babel' ) ; // parent is an app
15+ addBabelPlugin ( ) {
16+ let app = this . _findHost ( ) ;
1817
19- if ( babel . __CachedDecoratorPolyfillApplied ) return ;
20- babel . __CachedDecoratorPolyfillApplied = true ;
21-
22- const { _getEmberModulesAPIPolyfill } = babel ;
23-
24- babel . _getEmberModulesAPIPolyfill = function ( ...args ) {
25- const plugins = _getEmberModulesAPIPolyfill . apply ( this , args ) ;
26- if ( ! plugins ) return ;
27-
28- return [ [ resolve ( __dirname , './lib/transpile-modules.js' ) ] , ...plugins ] ;
29- } ;
18+ if ( ! hasPlugin ( app , 'ember-cache-decorator-polyfill' ) ) {
19+ addPlugin ( app , resolve ( __dirname , './lib/transpile-modules.js' ) ) ;
20+ }
3021 }
3122} ;
Original file line number Diff line number Diff line change 4141 "dependencies" : {
4242 "@glimmer/tracking" : " ^1.0.4" ,
4343 "ember-cache-primitive-polyfill" : " ^1.0.1" ,
44- "ember-cli-babel" : " ^7.21.0"
44+ "ember-cli-babel" : " ^7.21.0" ,
45+ "ember-cli-babel-plugin-helpers" : " ^1.1.1"
4546 },
4647 "devDependencies" : {
4748 "@ember/optional-features" : " ^2.0.0" ,
You can’t perform that action at this time.
0 commit comments