jaxwilko/wn-mix-plugin 问题修复 & 功能扩展

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

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

jaxwilko/wn-mix-plugin

Composer 安装命令:

composer require jaxwilko/wn-mix-plugin

包简介

README 文档

README

NOTICE: This plugin is now redundent since Winter v1.1.8. The functionality provided has been added to core, please see the docs.

Installation

Notice: NPN >=7.* is require for this plugin

We leverage the npm v7 feature workspaces to manage plugin resources from the application's root.

To set this up, you need to add the following to your root package.json:

"workspaces": {
    "packages": [
        "plugins/*/*",
        "themes/*"
    ]
}

Then run npm i. This can be done for you via the mix:install command.

Usage

Once installed, create a file at the root of a plugin or theme with the name winter.mix.js.

This file will be 90% the same as any laravel mix config file. However, you must set mix's publicPath.

Which you can do simply as:

mix.setPublicPath(__dirname);
// or
mix.setPublicPath(__dirname + '/assets');

For example if your plugin file structure was:

plugins/acme/myPlugin
  - assets
  - src
    - app.scss
  - Plugin.php

Then you could use the following in your winter.mix.js file:

let mix = require('laravel-mix');

mix.setPublicPath(__dirname + '/assets');

mix.sass('src/app.scss', 'app.css');

Compiling

Once you're all set up, you can use the mix command to run compilation.

Options:
  -l, --plugin[=PLUGIN]  Target a plugin.
  -t, --theme            Target the active theme.
  -d, --development      Run a development compile (this is default).
  -p, --production       Run a production compile.
  -w, --watch            Run and watch a development compile.
  -v                     Extra output

By default, the mix command runs in development mode, you can change this by using the --production flag.

You can only watch one thing at a time, so you must specify either --theme or --plugin author.plugin.

Examples

Compile theme assets:

  • ./artisan mix --theme
  • ./artisan mix --theme --production (for production)
  • ./artisan mix --theme --watch (in watch mode)

Compile plugin assets:

  • ./artisan mix --plugin jaxwilko.mix
  • ./artisan mix --plugin jaxwilko.mix --production (for production)
  • ./artisan mix --plugin jaxwilko.mix --watch (in watch mode)

Compile everything:

  • ./artisan mix
  • ./artisan mix --production (for production)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-07-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固