Angularjs 未生成样式文件夹
我在没有引导的情况下安装了yo webapp,然后根据以下答案添加了引导3: 我无法让grunt构建main.css并正确包含引导。在dist文件夹中未创建任何样式文件夹 运行“grunt build”时,我收到以下消息: 正在运行“cssmin:generated”(cssmin) 未写入任务目标,因为缩小的CSS为空 但是没有错误 我的GrunFile包括以下内容:Angularjs 未生成样式文件夹,angularjs,twitter-bootstrap-3,gruntjs,yeoman,grunt-usemin,Angularjs,Twitter Bootstrap 3,Gruntjs,Yeoman,Grunt Usemin,我在没有引导的情况下安装了yo webapp,然后根据以下答案添加了引导3: 我无法让grunt构建main.css并正确包含引导。在dist文件夹中未创建任何样式文件夹 运行“grunt build”时,我收到以下消息: 正在运行“cssmin:generated”(cssmin) 未写入任务目标,因为缩小的CSS为空 但是没有错误 我的GrunFile包括以下内容: useminPrepare: { options: { dest: '<%= yeoman.di
useminPrepare: {
options: {
dest: '<%= yeoman.dist %>'
},
html: '<%= yeoman.app %>/index.html'
},
usemin: {
options: {
assetsDirs: ['<%= yeoman.dist %>']
},
html: ['<%= yeoman.dist %>/{,*/}*.html'],
css: ['<%= yeoman.dist %>/styles/{,*/}*.css']
}
index.html包括:
<!-- build:css(.tmp,app) styles/main.css -->
<!-- bower:css -->
<!-- endbower -->
<!-- endbuild -->
<!-- build:css(.tmp,app) styles/bootstrap.css -->
<!-- bower:css -->
<!-- endbower -->
<!-- endbuild -->
{
"name": "gabriel",
"version": "0.0.1",
"dependencies": {
"bootstrap": "~3.0.2",
"jquery": "~2.0.3",
"modernizr": "~2.7.0"
},
"devDependencies": {}
}
我遗漏了什么?如中所述,请遵循相同的步骤。那应该对你有用。我只是做了,对我来说很好
总之
yo
-在这里对引导说“不”bower安装--保存引导程序
npm安装--保存开发grunt bower安装
Gruntfile.js
-按照确切的说明去做app/index.html
-仅添加以下行
<!-- bower:css -->
<!-- endbower -->
<!-- bower:js -->
<!-- endbower -->
grunt bower安装
grunt服务器
或grunt构建
显示以下错误的原因是 运行“cssmin:generated”(cssmin)任务>>未写入目标,因为缩小的CSS为空 引导css文件应该放置的位置可能放错了,因此正确放置引导css文件的位置如下-
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
<!-- endbower -->
我希望这会有帮助,伙计们…hm.还是一样的行为。下面是命令行中的输出:如果有帮助的话:css文件被复制到文本文件夹中,并在本地使用“grunt-serve”工作。您可以附加index.html和Grunfile.js吗。在dist folder.index.html中还有一个名为bower_components的文件夹在这里:grunfile.js在这里:
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
<!-- endbower -->