Grunt任务编译Bootstrap 4自定义scss

时间:2017-03-10 09:42:58

标签: css twitter-bootstrap gruntjs

我已经按照B4文档创建了一个_custom.scss文件来获取自定义的css文件。我通过执行B4下载附带的Gruntfile.js来执行一项艰巨的任务。我看到在css文件夹中,由于新的修改日期,所有文件都被覆盖了。但是将新bootstrap.css的内容与原始内容进行比较并没有显示出任何差异。我做错了什么?

由于

更新。我导入了_custom.scss。但似乎我有错误:

D:\bootstrap-4.0.0-alpha.6>grunt
>> Local Npm module "grunt-sass" not found. Is it installed?

Running "clean:dist" (clean) task
>> 1 path cleaned.

Running "exec:sass" (exec) task

> bootstrap@4.0.0-alpha.6 sass D:\bootstrap-4.0.0-alpha.6
> node-sass --output-style expanded --source-map true --precision 6 scss/bootstrap.scss dist/css/bootstrap.css && node-sass --output-style expanded --source-map true --precision 6 scss/bootstrap-grid.scss dist/css/bootstrap-grid.css && node-sass --output-style expanded --source-map true --precision 6 scss/bootstrap-reboot.scss dist/css/bootstrap-reboot.css

>> Rendering Complete, saving .css file...
>> Wrote Source Map to D:\bootstrap-4.0.0-alpha.6\dist\css\bootstrap.css.map
>> Wrote CSS to D:\bootstrap-4.0.0-alpha.6\dist\css\bootstrap.css
>> Rendering Complete, saving .css file...
>> Wrote CSS to D:\bootstrap-4.0.0-alpha.6\dist\css\bootstrap-grid.css
>> Wrote Source Map to D:\bootstrap-4.0.0-alpha.6\dist\css\bootstrap-grid.css.map
>> Rendering Complete, saving .css file...
>> Wrote CSS to D:\bootstrap-4.0.0-alpha.6\dist\css\bootstrap-reboot.css
>> Wrote Source Map to D:\bootstrap-4.0.0-alpha.6\dist\css\bootstrap-reboot.css.map

Running "exec:sass-docs" (exec) task

> bootstrap@4.0.0-alpha.6 sass-docs D:\bootstrap-4.0.0-alpha.6
> node-sass --output-style expanded --source-map true --precision 6 docs/assets/scss/docs.scss docs/assets/css/docs.min.css

>> Rendering Complete, saving .css file...
>> Wrote CSS to D:\bootstrap-4.0.0-alpha.6\docs\assets\css\docs.min.css
>> Wrote Source Map to D:\bootstrap-4.0.0-alpha.6\docs\assets\css\docs.min.css.map

Running "exec:postcss" (exec) task

> bootstrap@4.0.0-alpha.6 postcss D:\bootstrap-4.0.0-alpha.6
> postcss --config grunt/postcss.js --replace dist/css/*.css


Running "exec:clean-css" (exec) task

> bootstrap@4.0.0-alpha.6 clean-css D:\bootstrap-4.0.0-alpha.6
> cleancss --skip-advanced --source-map --output dist/css/bootstrap.min.css dist/css/bootstrap.css && cleancss --skip-advanced --source-map --output dist/css/bootstrap-grid.min.css dist/css/bootstrap-grid.css && cleancss --skip-advanced --source-map --output dist/css/bootstrap-reboot.min.css dist/css/bootstrap-reboot.css


Running "exec:clean-css-docs" (exec) task

> bootstrap@4.0.0-alpha.6 clean-css-docs D:\bootstrap-4.0.0-alpha.6
> cleancss --skip-advanced --source-map --output docs/assets/css/docs.min.css docs/assets/css/docs.min.css


Running "babel:dev" (babel) task
Warning: D:\bootstrap-4.0.0-alpha.6\node_modules\babel-plugin-transform-es2015-modules-strip\lib\index.js:4
      ModuleDeclaration(path) {
                       ^
Unexpected token ( Use --force to continue.

Aborted due to warnings.


Execution Time (2017-03-11 07:32:29 UTC-6)
exec:sass             1.6s  ███████████████████████ 28%
exec:sass-docs       735ms  ███████████ 13%
exec:postcss          1.4s  ████████████████████ 24%
exec:clean-css        1.3s  ███████████████████ 23%
exec:clean-css-docs  687ms  ██████████ 12%
Total 5.7s

知道那可能是什么吗?

更新2。 我跑了npm install --save-dev grunt-sass,我没有得到:

  
    

本地Npm模块" grunt-sass"未找到。它安装了吗?

  

但:  跑步" babel:dev" (巴贝尔)任务     警告:D:\ bootstrap-4.0.0-alpha.6 \ node_modules \ babel-plugin-transform-es2015-modules-strip \ lib \ index.js:4           ModuleDeclaration(path){                            ^     意外的令牌(使用--force继续。

Aborted due to warnings.

仍在发生。

更新3.使用 - 强制执行。不要

由于

0 个答案:

没有答案