Skip to content

Commit 648dbe6

Browse files
re-enabled embroider options like chunking and terser when building
1 parent 008e925 commit 648dbe6

File tree

1 file changed

+37
-38
lines changed

1 file changed

+37
-38
lines changed

packages/frontend/ember-cli-build.js

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
55
const { Webpack } = require('@embroider/webpack');
6-
// const { RetryChunkLoadPlugin } = require('webpack-retry-chunk-load-plugin');
7-
// const TerserPlugin = require('terser-webpack-plugin');
6+
const { RetryChunkLoadPlugin } = require('webpack-retry-chunk-load-plugin');
7+
const TerserPlugin = require('terser-webpack-plugin');
88
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
99

1010
module.exports = async function (defaults) {
@@ -79,41 +79,40 @@ module.exports = async function (defaults) {
7979
},
8080
});
8181

82-
// const embroiderOptions = {
83-
// staticAddonTestSupportTrees: true,
84-
// staticAddonTrees: true,
85-
// staticHelpers: true,
86-
// staticComponents: true,
87-
// splitAtRoutes: [
88-
// /about/,
89-
// /contact/,
90-
// /debuggery/,
91-
// // 'error', don't ever split the error route, it will break error handling
92-
// /links/,
93-
// /messages/,
94-
// /music/,
95-
// ],
96-
// packagerOptions: {
97-
// webpackConfig: {
98-
// plugins: [new RetryChunkLoadPlugin() /*, new BundleAnalyzerPlugin()*/],
99-
// devtool: env === 'production' ? 'source-map' : 'eval',
100-
// optimization: {
101-
// minimize: true,
102-
// minimizer: [
103-
// new TerserPlugin({
104-
// terserOptions: {
105-
// compress: {
106-
// passes: 6, // slow, but worth it
107-
// inline: 5,
108-
// reduce_funcs: false,
109-
// },
110-
// },
111-
// }),
112-
// ],
113-
// },
114-
// },
115-
// },
116-
// };
82+
const embroiderOptions = {
83+
staticAddonTestSupportTrees: true,
84+
staticAddonTrees: true,
85+
staticInvokables: true,
86+
// splitAtRoutes: [
87+
// /about/,
88+
// /contact/,
89+
// /debuggery/,
90+
// // 'error', don't ever split the error route, it will break error handling
91+
// /links/,
92+
// /messages/,
93+
// /music/,
94+
// ], disabled until https://github.com/embroider-build/embroider/issues/231 once again allows our loading routes to work
95+
packagerOptions: {
96+
webpackConfig: {
97+
plugins: [new RetryChunkLoadPlugin() /*, new BundleAnalyzerPlugin()*/],
98+
devtool: env === 'production' ? 'source-map' : 'eval',
99+
optimization: {
100+
minimize: true,
101+
minimizer: [
102+
new TerserPlugin({
103+
terserOptions: {
104+
compress: {
105+
passes: 6, // slow, but worth it
106+
inline: 5,
107+
reduce_funcs: false,
108+
},
109+
},
110+
}),
111+
],
112+
},
113+
},
114+
},
115+
};
117116

118-
return require('@embroider/compat').compatBuild(app, Webpack);
117+
return require('@embroider/compat').compatBuild(app, Webpack, embroiderOptions);
119118
};

0 commit comments

Comments
 (0)