- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我尝试使用 grunt 配置 uncss
我已经安装了
npm install grunt-uncss --save-dev
npm install grunt-processhtml --save-dev
uncss: {
dist: {
files: { 'dist/css/clean.css': ['index.php'] }
}
}
最后我加载它们并注册一个默认任务,如下所示:
grunt.loadNpmTasks('grunt-uncss');
grunt.loadNpmTasks('grunt-processhtml');
grunt.registerTask('default', ['uncss', 'processhtml']);
当我运行 grunt
最后我一直看到:
运行“uncss:dist”(uncss)任务
Fatal error: PhantomJS: Cannot open about:blank
我补充说:
processhtml: {
dist: {
files: {
'index.php': ['index.php']
}
}
}
运行grunt
后还是报同样的错误
最佳答案
如果这是您的全部代码,则您没有引用任何样式表来从中删除代码。您所做的只是告诉 grunt 清洁文件应该去哪里,并从 index.php 中删除所有未使用的 css。但是,它不知道 index.php 的样式存在于何处,因此它无事可做……您需要实际配置您的 processhtml 并告诉 uncss 您想要清理哪些样式表。
阅读指示 friend :
关于css - 如何在 grunt 中正确配置 uncss?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30308009/
我正在使用 多类选择器 对于我的 angular js 应用程序中的某些元素,如下所示: som text 在我的 CSS 文件中,我有 .first 和 .first.second 的其他更具体的属
我正在尝试使用 uncss 删除 css但它会删除所有样式,无论它们是否列在 ignore 数组中。 我想要比较的 2 个文件只是索引和 app.min.js,其中包含作为字符串嵌入 javascri
我需要在 UnCSS 中传递表单数据以登录到我的网站访问控制区域,但是我似乎找不到任何有关如何执行此操作的示例。我知道 UnCSS 使用 PhantomJS,我已经很容易地让 PhantomJS 做到
忽略选项似乎对我不起作用。 我正在执行以下操作: .pipe(plugins.uncss({ html: glob.sync('./**/*.{csh,h}tml'),
我正在使用 grunt-uncss 清理我正在处理的 bootstrap/angularjs 元素中的 css 选择器。我正在使用 urls 选项,因为我需要 uncss 在运行时解析 css,因为它
我正在尝试对我所有的 js 和 css 文件使用 gulp-uncss。只有 css 文件才能正常工作,问题是我的 application.js 具有以下结构: "use strict"; (func
我已经编写了 grunt uncss 任务来删除代码中未使用的 css。但是它删除了我的代码中使用的很多 css。我想原因是,它没有检查指令 'my-directive' 中的 css这是我的 ind
我是 gulp 和 uncss 的新手,不确定我的逻辑是否有缺陷,或者我需要的东西是否不可能。 我希望 uncss 忽略大量以特定字符串为前缀的 CSS 规则,但它们的声明中链接了许多复合选择器。 我
我正在尝试通过使用 uncss 删除我正在使用的框架中所有未使用的 css。但是当我尝试时出现错误: file:///C:/Users/Angus/Desktop/FTTL%20website%20s
我尝试使用 grunt 配置 uncss 我已经安装了 npm install grunt-uncss --save-dev npm install grunt-processhtml --save-
我有 uncss(github 上的一个元素)来删除响应式网站不需要的 css。它还会删除 mobile.css 文件中提到的 css,但它实际上会影响移动 View 中的站点。我不知道 uncss
与 uncss我们可以从样式表中删除未使用的 css。它通过查看要部署的 html 文件并仅打包使用的 css 规则来工作。 Angular 4 有像这样应用条件 css 的指令: 任何人都知道是否
我是 grunt 的新手,我正在努力学习它。如果我有 index.html 文件要处理,这有点简单,但我没有,我有 index.php - 所以我试过了: uncss: { dist: {
我想使用 grunt 插件“uncss”。但我仍然错过了 Bootstrap 模式的一些类。现在我的 uncss grunt 设置如下所示: uncss: { dist: {
我有一个使用 React 的项目,我想修剪我的 CSS 构建文件。 React 没有 html 文件,所以我不知道如何让 UnCSS 与 React 一起工作。我可以将 React 与 UnCSS 一
我正在使用 gulp uncss。这是我的任务代码: gulp.task('uncss', () => { return gulp.src($uncss.src) .pipe(uncss(
我遇到了一些正则表达式问题。 使用 gulp-uncss 我想向忽略选项添加一些类。 任何以 .no- 开头的类 任何包含 .is- 的类 .no-flexbox {} .test.is-active
我一直在通过谷歌寻找一种方法来做我想做的事,但没有成功。 这是我的 gulp 任务 gulp.task('less', function() { return gulp.src('cs
我继承了一个网站,其中包含几个巨大的 css 文件,使用 Firefox 中的 DUst-Me Selector 进行分析后,我返回了将近 2000 个未使用的样式。 要删除它们,我正在尝试使用 gr
正如预期的那样,当我在我的 index.html 文件上运行 gulp uncss 时,它从我的样式表中删除了所有未在 html 中使用的 css 规则。问题是我的应用程序主要是 javascript
我是一名优秀的程序员,十分优秀!