定制 mrfd/kirby-mix 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

mrfd/kirby-mix

Composer 安装命令:

composer require mrfd/kirby-mix

包简介

Laravel Mix integration for Kirby, which hooks into the existing helper functions.

README 文档

README

This plugin integrates the Laravel Mix manifest into Kirby, using the existing js() and css() helper functions.

Commerical Usage

This plugin is free but if you use it in a commercial project please consider to

Requirements

  • PHP 8.0+
  • Kirby 3+

Installation

Download

Download and copy the files to /site/plugins/kirby-mix.

Git submodule

$ git submodule add https://github.com/MRFD/kirby-mix.git site/plugins/kirby-mix

Composer

composer require MRFD/kirby-mix

Usage

This plugin helps with the long-term caching that Laravel Mix provides with the mix.version() function. Read more about it in the Laravel Mix documentation.

The plugin is enabled by default, and passes files trough that are not in the manifest. All functionality offered by the js() and css() helpers remains unchanged.

Usage example

<?= css('assets/js/app.css') ?>

<?= js('assets/js/app.js') ?>
<script src="https://domain.com/assets/js/app.js?id=c14116f0ac177cab618e"></script>

<link
  href="https://domain.com/assets/css/app.css?id=ffd6ebc479deb7f64dec"
  rel="stylesheet"
/>

Example webpack.mix.js

const mix = require("laravel-mix");

mix
  .setPublicPath("assets")
  .setResourceRoot("../")
  .sass("resources/assets/css/app.scss", "js")
  .js("resources/assets/js/app.js", "css")
  .version();

Options

Option Default Description
mrfd.mix.enable true Activated or deactivated the Kirby Mix plugin.
mrfd.mix.manifest mix-manifest.json File name including extension of the manifest file.
mrfd.mix.publicPath assets The public path to the assets folder.

Disclaimer

This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.

License

Kirby Mix is open-sourced software licensed under the MIT license.

Copyright © 2020 Marijn Roovers

Credits

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固