我已经将我的 grunt 插件拆分到它们自己的文件中,并且我正在使用 load-grunt-config (https://github.com/firstandthird/load-grunt-config) 来调用它们:
module.exports = function (grunt) {
'use strict';
require('load-grunt-config')(grunt);
};
我有 sass、autoprefixer、cssmin 和 watch 任务,但我也在使用 Browsersync 和 px-to-rem 这两个插件返回:
Warning: Task "remify" not found. Use --force to continue.
和
Warning: Task "browsersync" not found. Use --force to continue.
单独调用或作为更大任务的一部分调用时。
我遵循了这两个插件的 separate.js 文件的语法,所以我不知所措。例如运行grunt时调用的remify.js文件是这样写的
module.exports = {
dist: {
options: {
base: 16,
fallback: true,
fallback_existing_rem: true,
ignore: []
},
files: {
'css/style.css': 'css/style.css'
}
}
};
有什么地方出了问题吗?
我还设置了示例代码的要点,包括 package.json 和 aliases.yml
最佳答案
您必须准确地调用 grunt 插件。因此,在我有 remify
的地方,我应该使用 px_to_rem
,在我有 browsersync
的地方,我应该有 browserSync
.
傻我。
关于javascript - 使用 load-grunt-config 找不到 Grunt 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27078173/