diff --git a/bin/run-tests.js b/bin/run-tests.js index f711cce03b6..1be43af5751 100755 --- a/bin/run-tests.js +++ b/bin/run-tests.js @@ -101,16 +101,16 @@ function generateBuiltTests() { return run(common + '&enableoptionalfeatures=true&dist=prod&prod=true'); }); testFunctions.push(function() { - return run(common + '&ie=true&nolint=true'); + return run(common + '&legacy=true&nolint=true'); }); testFunctions.push(function() { - return run(common + '&ie=true&dist=min&prod=true'); + return run(common + '&legacy=true&dist=min&prod=true'); }); testFunctions.push(function() { - return run(common + '&ie=true&dist=prod&prod=true'); + return run(common + '&legacy=true&dist=prod&prod=true'); }); testFunctions.push(function() { - return run(common + '&ie=true&enableoptionalfeatures=true&dist=prod&prod=true'); + return run(common + '&legacy=true&enableoptionalfeatures=true&dist=prod&prod=true'); }); } diff --git a/ember-cli-build.js b/ember-cli-build.js index 01f753f1f1b..b0a91ef4e44 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -124,7 +124,7 @@ module.exports = function() { toES5(templateCompilerDependenciesES) ); - bundleTrees.push(new Funnel(bundlesES5, { destDir: 'ie' })); + bundleTrees.push(new Funnel(bundlesES5, { destDir: 'legacy' })); } let emberTestsEmptyTestem = new Funnel('tests', { diff --git a/lib/index.js b/lib/index.js index 31d7f7a25c4..4d2a49f1453 100644 --- a/lib/index.js +++ b/lib/index.js @@ -69,12 +69,21 @@ module.exports = { let emberSourceDistPath = path.join(__dirname, '..', 'dist'); - if (this.project.targets) { - let browsers = browserslist(this.project.targets.browsers); - - if (browsers.find(browser => browser.startsWith('ie'))) { - emberSourceDistPath = path.join(emberSourceDistPath, 'ie'); - } + let emberCliBabel = this.addons.find(a => a.name === 'ember-cli-babel'); + let needsLegacyBuild = [ + 'transform-template-literals', + 'transform-literals', + 'transform-arrow-functions', + 'transform-destructuring', + 'transform-spread', + 'transform-parameters', + 'transform-computed-properties', + 'transform-shorthand-properties', + 'transform-block-scoping', + ].some(p => emberCliBabel.isPluginRequired(p)); + + if (needsLegacyBuild) { + emberSourceDistPath = path.join(emberSourceDistPath, 'legacy'); } let emberFiles = [ diff --git a/package.json b/package.json index 16af7c51e20..644f55e2bf9 100644 --- a/package.json +++ b/package.json @@ -24,16 +24,16 @@ "dist/ember.min.map", "dist/ember.prod.js", "dist/ember.prod.map", - "dist/ie/ember-template-compiler.js", - "dist/ie/ember-template-compiler.map", - "dist/ie/ember-testing.js", - "dist/ie/ember-testing.map", - "dist/ie/ember.debug.js", - "dist/ie/ember.debug.map", - "dist/ie/ember.min.js", - "dist/ie/ember.min.map", - "dist/ie/ember.prod.js", - "dist/ie/ember.prod.map", + "dist/legacy/ember-template-compiler.js", + "dist/legacy/ember-template-compiler.map", + "dist/legacy/ember-testing.js", + "dist/legacy/ember-testing.map", + "dist/legacy/ember.debug.js", + "dist/legacy/ember.debug.map", + "dist/legacy/ember.min.js", + "dist/legacy/ember.min.map", + "dist/legacy/ember.prod.js", + "dist/legacy/ember.prod.map", "docs/data.json", "lib/index.js", "vendor/ember" @@ -65,6 +65,7 @@ "broccoli-merge-trees": "^2.0.0", "browserslist": "^4.3.4", "chalk": "^2.3.0", + "ember-cli-babel": "^7.1.3", "ember-cli-get-component-path-option": "^1.0.0", "ember-cli-is-package-missing": "^1.0.0", "ember-cli-normalize-entity-name": "^1.0.0", diff --git a/tests/index.html b/tests/index.html index 6e9a6b9644f..b63fd561354 100644 --- a/tests/index.html +++ b/tests/index.html @@ -74,9 +74,9 @@