vendi-advertising/vendi-asset-loader 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vendi-advertising/vendi-asset-loader

Composer 安装命令:

composer require vendi-advertising/vendi-asset-loader

包简介

Dynamically enqueue CSS and JS files

README 文档

README

PHP Composer codecov License: MIT Maintainability

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 both THEME_CSS_MODE and THEME_JS_MODE into static mode
      • stage - No difference currently
      • dev (default) - No difference currently
  • 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]-*.css
      • static - Loads CSS files as defined in the webpack encore entry file
    • Usage notes:
      • If THEME_MODE is set to prod, this configured value is ignore and instead static is always used
  • 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]-*.js
      • static - Loads JS files as defined in the webpack encore entry file
    • Usage notes:
      • If THEME_MODE is set to prod, this configured value is ignore and instead static is always used
  • 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
  • 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

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 vendi-advertising/vendi-asset-loader 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 584
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-24