antoniocarboni / magento2-gulp
此软件包已被弃用且不再维护。未建议替代软件包。
新的 Magento2 gulpfile
1.0.0
2017-07-17 03:00 UTC
This package is not auto-updated.
Last update: 2020-08-22 05:42:16 UTC
README
为 Magento 2 新建的 gulpfile
安装
- 更新您的 composer.json 文件
“require-dev”: {
...
“antoniocarboni/magento2-gulp”:"2.0.*”
},
"repositories": [
{ "type": "vcs", "url": "https://github.com/magenio-it/magento2-gulp" }
],
- 运行 composer update
- 安装 node.js
- 将
package.gulp.json.sample重命名为package.json - 运行
npm install - 使用
npm install -g gulp-cli全局安装 gulp - 在
dev/gulp-configs.js中定义您的 gulp 配置,使用文件样本 gulp-configs.sample.js
configs.js 结构
此 gulpfile 的 gulp-configs.js 文件有一些选项
选项
debug: 启用详细模式(true/false)liveReload: 启用 LiveReload 插件(true/false)browsersync: 启用 Browsersync 插件(true/false)cache-disable: 在开发者模式下默认禁用缓存
less
sourcemap: 在 less 编译期间创建 sourcemap(true/false)singletheme: 如果设置,less 任务将只监视指定的主题以加快编译速度
监视
supwatch
extensionPermitted: 检查创建 pub/static 目录符号链接的特定扩展folderCustomTheme: 定制主题所在的目录。目前 superwatch 只能同时处理一个定制主题。使用 'app' 作为 app/design/ 中的定制主题,或者使用 'Vendorname/themename' 作为由 composer 管理的定制主题notifyAll: 通知不需要符号链接在 pub/static 的文件更改notifyExt: 为通知添加特定的文件扩展名过滤器
执行
enableDefaultTask: 如果设置,任务 deploy 不带参数使用默认任务集(true/false)defaultTask: 如果启用 enableDefaultTask,将运行的默认任务staticFolderToClear: 在部署源主题之前清除 pub/static 主题的完整路径。
browsersync
有关更多信息及所有配置,请访问 https://browsersync.io/docs
任务列表
prepare-dev: 设置开发者模式并禁用缓存default: 运行 less 任务less: 编译 LESS 文件。参数-
--[nometema]: 仅针对特定主题编译
watch: 监视文件更改并运行处理任务和/或浏览器同步重新加载-
--[nometema]: 仅监视特定主题
superwatch: 监视 less 文件并在 pub/static 上自动创建和删除符号链接,而无需运行 'exec' 命令browser-sync: 重新加载浏览器页面exec: 执行 dev:source-theme:deploy 命令cache-disable: 禁用特定缓存cache-clear:清除Magento2缓存developer:将Magento2设置为开发者模式