grunt 编译

magento 收藏
0 71
1.安装node.js

2.全局安装grunt-cli
npm install -g grunt-cli

3.在根目录复制以下文件
package.json.sample to package.json
Gruntfile.js.sample to Gruntfile.js
grunt-config.json.sample into grunt-config.json

修改grunt-config.json

{
"themes": "dev/tools/grunt/configs/themes"
}
4.在magento中安装依赖,根目录 npm install npm update 5.增加自定义主题到grunt, dev/tools/grunt/configs/themes.js, 如下: <theme>: { area: '', name: '/', locale: '', files: [ '', //path to root source file '' ], dsl: 'less' }
grunt 命令

grunt clean 清楚静态文件和缓存
grunt exec 生成静态符号链接文件
grunt less 编译css文件,可以用grunt less:theme编译指定文件
grunt watch 自动编译文件,刷新网页即可看见效果

如本地开发,浏览器可借助livereload扩展,结合grunt watch自动刷新,无需手动reload


上一主题: 阻止冒泡
下一主题: git 命令
    暂时没有人评论
精选帖子
热门帖子
1创建flutter应用 93
2js 变量命令法 92
3回流和重绘 92
4js 添加邮箱验证 91
5应用配置 91
6flutter 构建模式 90
7在phtml中使用图片 89
8作用域 89
9v-if 和 v-else 89