Skip to content

Commit

Permalink
Optimized autoloader in production builds
Browse files Browse the repository at this point in the history
  • Loading branch information
marekdedic committed Aug 25, 2021
1 parent e04500e commit 10b6291
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: "Install Composer dependencies"
run: |
composer install -n --prefer-dist
composer -n install
- name: "Cache NPM dependencies"
uses: actions/[email protected]
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
- name: "Install Composer dependencies"
run: |
composer install -n --prefer-dist
composer -n install
- name: "Cache NPM dependencies"
uses: actions/[email protected]
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
- name: "Install Composer dependencies"
run: |
composer install -n --prefer-dist
composer -n install
- name: "Cache NPM dependencies"
uses: actions/[email protected]
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: "Install Composer dependencies"
run: |
composer install -n --prefer-dist
composer -n install
- name: "Cache NPM dependencies"
uses: actions/[email protected]
Expand All @@ -49,6 +49,9 @@ jobs:
npm ci
- name: "Build"
with:
env:
NODE_ENV: 'production'
run: |
npm run build
Expand Down
5 changes: 4 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ gulp.task(
gulp.task(
'build:deps:composer:autoloader',
gulp.series(
shell.task( 'composer dump-autoload --no-dev' ),
shell.task(
'composer dump-autoload --no-dev' +
( process.env.NODE_ENV === 'production' ? ' -o' : '' )
),
function () {
return merge(
gulp.src( [
Expand Down

0 comments on commit 10b6291

Please sign in to comment.