Skip to content

Commit

Permalink
Merge pull request #7267 from jrjohnson/enable-embroider
Browse files Browse the repository at this point in the history
Enable embroider
  • Loading branch information
dartajax authored Jan 25, 2024
2 parents ff6f669 + 0cafbae commit b6801d9
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 84 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,36 +74,6 @@ jobs:
- name: test build
run: npm run build

test-with-embroider:
name: Test With Embroider
runs-on: ubuntu-latest
timeout-minutes: 15
env:
BUILD_WITH_EMBROIDER: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.17
cache: npm
- run: npm ci
- run: npm run test:ember

build-with-embroider:
name: Build With Embroider
runs-on: ubuntu-latest
timeout-minutes: 10
env:
BUILD_WITH_EMBROIDER: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.17
cache: npm
- run: npm ci
- run: npm run build

browserstack-test:
name: Browserstack ${{ matrix.launcher }}
runs-on: ubuntu-latest
Expand Down
103 changes: 49 additions & 54 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,61 +61,56 @@ module.exports = function (defaults) {
},
});

if (process.env.BUILD_WITH_EMBROIDER) {
return require('@embroider/compat').compatBuild(app, Webpack, {
staticAddonTestSupportTrees: true,
staticAddonTrees: true,
staticHelpers: true,
staticComponents: true,
splitAtRoutes: [
//temporarily disabled route splitting for https://github.com/ilios/ilios/issues/4508
/admin[a-z-]*/,
'assign-students',
/course[a-z-]*/,
/curriculum[a-z-]*/,
'dashboard.activities',
'dashboard.calendar',
'dashboard.materials',
'error',
'events',
'four-oh-four',
/instructor[a-z-]*/,
/learner[a-z-]*/,
'login',
'logout',
'myprofile',
'pending-user-updates',
'print-course',
/program[a-z-]*/,
/report[a-z-]*/,
/school[a-z-]*/,
'search',
/session[a-z-]*/,
/user[a-z-]*/,
'verification-preview',
'weeklyevents',
],
packagerOptions: {
webpackConfig: {
plugins: [new RetryChunkLoadPlugin() /*, new BundleAnalyzerPlugin()*/],
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
compress: {
passes: 6, // slow, but worth it
inline: 5,
reduce_funcs: false,
},
return require('@embroider/compat').compatBuild(app, Webpack, {
staticAddonTestSupportTrees: true,
staticAddonTrees: true,
staticHelpers: true,
staticComponents: true,
splitAtRoutes: [
/admin[a-z-]*/,
'assign-students',
/course[a-z-]*/,
/curriculum[a-z-]*/,
'dashboard.activities',
'dashboard.calendar',
'dashboard.materials',
'error',
'events',
'four-oh-four',
/instructor[a-z-]*/,
/learner[a-z-]*/,
'login',
'logout',
'myprofile',
'pending-user-updates',
'print-course',
/program[a-z-]*/,
/report[a-z-]*/,
/school[a-z-]*/,
'search',
/session[a-z-]*/,
/user[a-z-]*/,
'verification-preview',
'weeklyevents',
],
packagerOptions: {
webpackConfig: {
plugins: [new RetryChunkLoadPlugin() /*, new BundleAnalyzerPlugin()*/],
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
compress: {
passes: 6, // slow, but worth it
inline: 5,
reduce_funcs: false,
},
}),
],
},
},
}),
],
},
},
});
} else {
return app.toTree();
}
},
});
};

0 comments on commit b6801d9

Please sign in to comment.