Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Commit

Permalink
Require files manually in case there's no Composer Autoloader, to red…
Browse files Browse the repository at this point in the history
…uce plugin size.
  • Loading branch information
felixarntz committed Sep 5, 2019
1 parent 5eddf82 commit 5c4a8b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ cd $SVNPATH/trunk/

printf "Building assets..."
rm -rf vendor
composer install --no-dev
composer install
rm -rf node_modules
npm install
npm run build
Expand All @@ -115,6 +115,7 @@ rm README.md
rm -rf .github
rm -rf node_modules
rm -rf tests
rm -rf vendor
echo "Done."

printf "Ignoring GitHub specific files and deployment script..."
Expand Down
6 changes: 6 additions & 0 deletions native-lazyload.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ function native_lazyload_load() {

if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require __DIR__ . '/vendor/autoload.php';
} elseif ( ! class_exists( 'Google\\Native_Lazyload\\Plugin' ) ) {
$plugin_dir = plugin_dir_path( __FILE__ );
require_once $plugin_dir . 'src/Plugin.php';
require_once $plugin_dir . 'src/Context.php';
require_once $plugin_dir . 'src/Lazy_Loader.php';
require_once $plugin_dir . 'src/Lazy_Load_Script.php';
}

call_user_func( [ 'Google\\Native_Lazyload\\Plugin', 'load' ], __FILE__ );
Expand Down

0 comments on commit 5c4a8b3

Please sign in to comment.