envoy/frontools
Composer 安装命令:
composer require envoy/frontools
包简介
Set of front-end tools for Magento 2, based on Gulp.js
README 文档
README
Magento 2 Frontools
Set of front-end tools for Magento 2, based on Gulp.js
Questions
If you have any questions about this project let's go to offical Magento forum - Less to Sass Community Project
Requirements
- Unix-like OS (please, do not ask about Windows support)
- Node.js LTS version (currently branch v6). We recommend to use avn to automate version switching. Required configuration is already added to repository as
.node-versionfile. - Gulp CLI global package -
yarn global add gulp-cliornpm install -g gulp-cli - Magento 2 project with SASS based theme i.e. SASS version of "Blank"
Installation
- Run
composer require snowdog/frontools - Go to package directory
cd vendor/snowdog/frontools - Run
yarnornpm install - Decide where you want to keep your config files.
You can store them in Frontools
configdirectory or indev/tools/frontools/config. There is agulp setuptask to copy all sample config files from theconfigtodev/tools/frontools/configand create a convenient symlinktoolsin the project root. If you want to keep config files inside frontoolsconfigdir, you have to handle this manually. - Define your themes in
themes.json.
themes.json structure
Check config/themes.json.sample to get samples.
src- full path to themedest- full path topub/static/[theme_area]/[theme_vendor]/[theme_name]locale- array of available localesparent- name of parent themestylesDir- (defaultstyles) path to styles directory. Fortheme-blank-sassit'sstyles. By default Magento 2 useweb/css.disableSuffix- disable adding.minsuffix using--prodflag.postcss- (deafult["plugins.autoprefixer()"]) PostCSS plugins config. Have to be an array.modules- list of modules witch you want to map inside your themeignore- array of ignore patterns
watcher.json structure
Check config/watcher.json.sample to get samples.
usePolling- set this totrueto successfully watch files over a network (i.e. Docker or Vagrant) or when your watcher dosen't work well. Warining, enabling this option may lead to high CPU utilization! chokidar docs
Optional configurations for 3rd party plugins
You will find sample config files for theses plugins in vendor/snowdog/frontools/config directory.
- Create browserSync configuration
- Create eslint configuration
- Create sass-lint configuration
- Create stylelint configuration
- Create svg-sprite configuration
Tasks list
babel- Run Babel, a compiler for writing next generation JavaScript.--theme name- Process single theme.--prod- Production output - minifies and uglyfy code.
clean- Removes/pub/staticdirectory content.csslint- Run stylelint based tests.--theme name- Process single theme.--ci- Enable throwing errors. Useful in CI/CD pipelines.
default- typegulpto see this readme in console.dev- Runs browserSync andinheritance,babel,styles,watchtasks.--theme name- Process single theme.--disableLinting- Disable SASS and CSS linting.--disableMaps- Toggles source maps generation.
eslint- Watch and run eslint on specified JS file.--file fileName- You have to specify what file you want to lint, fileName without .js.
inheritance- Create necessary symlinks to resolve theme styles inheritance and make the base for styles processing. You have to run in before styles compilation and after adding new files.sasslint- Run sass-lint based tests.--theme name- Process single theme.--ci- Enable throwing errors. Useful in CI/CD pipelines.
setup- Creates a convenient symlink from/toolsto/vendor/snowdog/frontoolsand copies all sample files if no configuration exists.--symlink name- If you don't want to usetoolsas the symlink you can specify another name.
styles- Use this task to manually trigger styles processing pipeline.--theme name- Process single theme.--disableMaps- Toggles source maps generation.--prod- Production output - minifies styles and add.minsufix.--ci- Enable throwing errors. Useful in CI/CD pipelines.
svg- Run svg-sprite to generate SVG sprite.--theme name- Process single theme.
watch- Watch for style changes and run processing tasks.--theme name- Process single theme.--disableLinting- Disable SASS and CSS linting.--disableMaps- Enable inline source maps generation.
envoy/frontools 适用场景与选型建议
envoy/frontools 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 2.18k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2017 年 11 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 envoy/frontools 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 envoy/frontools 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.18k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-11-14