Skip to content

Commit

Permalink
[BUGFIX lts] Adds the babel-helpers injection plugin back
Browse files Browse the repository at this point in the history
Helpers were no longer being externalized in our builds, which adds a
significant amount to the final payload. This adds them back into the
build.

Also fixes an issue where the template compiler was not being included
in the vendor folder for Ember.
  • Loading branch information
Chris Garrett committed Aug 20, 2019
1 parent d105c96 commit c74c82b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const resolve = require('resolve');
const concatBundle = require('./concat-bundle');
const buildDebugMacroPlugin = require('./build-debug-macro-plugin');
const buildStripClassCallcheckPlugin = require('./build-strip-class-callcheck-plugin');
const injectBabelHelpers = require('./transforms/inject-babel-helpers');

const isProduction = process.env.EMBER_ENV === 'production';

Expand Down Expand Up @@ -79,6 +80,7 @@ module.exports = {
babel: Object.assign({}, babelOptions, {
loose: true,
plugins: [
injectBabelHelpers,
buildDebugMacroPlugin(!isProduction),
[
require.resolve('@babel/plugin-transform-block-scoping'),
Expand Down Expand Up @@ -157,6 +159,11 @@ module.exports = {
files: ['jquery.js'],
});

let templateCompiler = new Funnel(tree, {
destDir: 'ember',
include: ['ember-template-compiler.js', 'ember-template-compiler.map'],
});

let ember;
let targets = (this.project && this.project.targets && this.project.targets.browsers) || [];

Expand All @@ -174,6 +181,6 @@ module.exports = {
});
}

return new MergeTrees([ember, jquery]);
return new MergeTrees([ember, templateCompiler, jquery]);
},
};
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"test:browserstack": "node bin/run-browserstack-tests.js"
},
"dependencies": {
"@babel/helper-module-imports": "^7.0.0",
"@babel/plugin-transform-block-scoping": "^7.4.4",
"@babel/plugin-transform-object-assign": "^7.2.0",
"babel-plugin-debug-macros": "^0.3.2",
Expand All @@ -70,7 +71,6 @@
"silent-error": "^1.1.1"
},
"devDependencies": {
"@babel/helper-module-imports": "^7.0.0",
"@babel/preset-env": "^7.5.5",
"@glimmer/compiler": "0.38.5-alpha.2",
"@glimmer/env": "^0.1.7",
Expand Down

0 comments on commit c74c82b

Please sign in to comment.