vendi-advertising/vendi-asset-loader
Composer 安装命令:
composer require vendi-advertising/vendi-asset-loader
包简介
Dynamically enqueue CSS and JS files
README 文档
README
Version 1 was a more complex version that supported multiple loading paths. It has since been rewritten to be much simpler and follow common patterns with less customizations (that were almost never used). Please only use version 2 going forward. You can find the version 1 documention here.
Install
composer require vendi-advertising/vendi-asset-loader:^2
Configure
The asset loader relies almost completely on the following environment variables.
NOTE! This module does not actually perform logic related to .env files, it is up to the theme to handle this if needed. Generally speaking, however, you can usually create a file named .env.local with these values to override. Otherwise the system assumes true environment variables.
THEME_MODE- Supported values:
prod- Forces bothTHEME_CSS_MODEandTHEME_JS_MODEintostaticmodestage- No difference currentlydev(default) - No difference currently
- Supported values:
THEME_CSS_MODE- Supported values:
dynamic(default) - Loads CSS files from the/css/relative to the path theme root following the glob pattern/css/[0-9][0-9][0-9]-*.cssstatic- Loads CSS files as defined in the webpack encore entry file
- Usage notes:
- If
THEME_MODEis set toprod, this configured value is ignore and insteadstaticis always used
- If
- Supported values:
THEME_JS_MODE- Supported values:
dynamic(default) - Loads JS files from the/js/relative to the path theme root following the glob pattern/js/[0-9][0-9][0-9]-*.jsstatic- Loads JS files as defined in the webpack encore entry file
- Usage notes:
- If
THEME_MODEis set toprod, this configured value is ignore and insteadstaticis always used
- If
- Supported values:
THEME_WEBPACK_ENTRY_FILE- Supported values:
- Either the absolute path to the webpack file or a path relative to the theme's root
- Default:
./static/build/entrypoints.json
- Supported values:
THEME_WEBPACK_ENTRY_DEFAULT- Supported values:
- The name for the theme's default entry that should represent the bulk of the CSS and JS required to load the site.
- Default:
main
- Supported values:
Usage
add_action(
'wp_enqueue_scripts',
function()
{
\Vendi\VendiAssetLoader\Loader::enqueue_default();
}
);
vendi-advertising/vendi-asset-loader 适用场景与选型建议
vendi-advertising/vendi-asset-loader 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 584 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 10 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 vendi-advertising/vendi-asset-loader 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vendi-advertising/vendi-asset-loader 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 584
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-10-24