roy-veldman/wirecraft
Composer 安装命令:
composer require roy-veldman/wirecraft
包简介
Boilerplate for Craft CMS project, which include webpack and a basic structure
README 文档
README
Build instructions
composer create-project roy-veldman/wirecraft [projectname]cdinto the project- create database
mysql -u [username](add-pif you have a password)create database [database-name];
- run
./craft setup/index - run
composer update - run
npm install - run
npm run dev - Login to the back-end
- Setup the homepage
- Go to settings -> plugins, and install the plugins
- Create Assets in the uploads folder
@web/assets/uploads/{images}
- Created an uploads folder for all the images and files you set-up in craft, this folder does not get pushed so you won't have any conflicts with local and production. The static images that are hardcoded or static icons are in the actual image or icons folder, these can be pushed.
Production build
run npm run build if you are ready for production, this will minify the javascript and css files.
Starting instructions
If you created a homepage on the back-end of craft, whether is a single page or a structure you can start with the code below.
- Example of the filename
pages/_entry.twig
{% extends 'layouts/_master' %}
{% block content %}
{# content comes here #}
{% endblock %}
Additional information
VueJS
- VueJs is already standard in the boilerplate, if you want to make use of it, follow the following steps:
- Inside app.js
import Vue from 'vue'
new Vue({
el: [targetElement]
});
- Inside JS folder
- create components folder
- create
.vuefiles
- In the
.vuefiles you can also access the global variables from your scss files, if you want to add or change this go intowebpack.common.jsand configure theconfigureCssLoader()
Jquery
- If you want to use Jquery on your project (which i don't recommend), follow the steps below
- All these changes are in the
webpack.common.js
// At the top of the file add the webpack variable const webpack = require('webpack'); // Inside the plugins add the following plugin, // Add this below the CopyWebpackPlugin new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' })
Boilerplate information
- Craft CMS (clean install)
- Basic folder structure
- Src folder with JS and SCSS
- Starting files (
app.scss/app.js) - Standard mobile mixin ( already includes in
app.scss) - Layout folder with
_master.twigfile, which contains basic layout file ( css and js includes aswell as seo plugin )
- Craft Module
- Cache busting (gives the css and js files a version number)
- Craft Plugins
- Entry instructions
- Super table
- SEO
- Redactor
- Webpack (for compiling css and js)
- ES6 functionality
- SCSS
- VueJS
- File-loader
- Babel
- Copying static assets ( standard fonts and icons )
- Minify CSS and JS on production ( prefix included! )
- Live server with hot reload
- Clean files plugin ( removes unused css and js files from assets folder )
By Roy Veldman
roy-veldman/wirecraft 适用场景与选型建议
roy-veldman/wirecraft 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 74 次下载、GitHub Stars 达 2, 最近一次更新时间为 2018 年 12 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 roy-veldman/wirecraft 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 roy-veldman/wirecraft 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 74
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-12-17