1
에서 생성 된 파일을 포함하여이 내 index.html
의 관련 부분 :그런트가 : usemin
<!-- build:js scripts/scripts.js -->
<script src="scripts/vendor/jquery.js"></script>
<script src="scripts/vendor/bootstrap.min.js"></script>
<script src="scripts/vendor/handlebars.runtime.js"></script>
<script src="scripts/vendor/ember.js"></script>
<script src="scripts/vendor/ember-data.js"></script>
<script src="scripts/templates.js"></script>
<script src="scripts/neuterapp.js"></script>
<!-- endbuild -->
이것은 관련 (하지만 마지막 두 entrires이 잘못, 내 문제가 실제로) Gruntfile.js
의 일부 :
useminPrepare: {
html: '<%= yeoman.app %>/index.html',
options: {
dest: '<%= yeoman.dist %>'
}
},
usemin: {
html: ['<%= yeoman.dist %>/*.html'],
css: ['<%= yeoman.dist %>/styles/*.css'],
options: {
dirs: ['<%= yeoman.dist %>']
}
},
내가 모두 templates.js
및 neuterapp.js
유전자 있다는 것입니다이 문제 정격 파일이므로 <%= yeoman.app %>/scripts
이 아니라 <%= yeoman.dist %>/scripts
에 있습니다.
이 내 (간체) 디렉토리 구조입니다 :
webapp/
├── app
│ ├── app.js <--- for neuter
│ ├── controllers
│ ├── index.html
│ ├── models
│ ├── routes
│ ├── scripts
│ │ └── vendor <--- for usemin
│ ├── templates <--- for ember_templates
│ │ ├── template1.hbs
│ │ └── template2.hbs
│ └── views
├── dist
│ ├── index.html
│ └── scripts
│ ├── neuterapp.js <--- this must also be used for usemin!!!
│ └── templates.js <--- this must also be used for usemin!!!
└── Gruntfile.js
가 어떻게 usemin
을 말할 수있는 몇 가지 생성 된 파일을 포함하는?
neuter: {
options: {
includeSourceURL: true
},
'<%= yeoman.dist %>/scripts/neuterapp.js': '<%= yeoman.app %>/app.js'
},
ember_templates: {
compile: {
options: {
templateName: function (sourceFile) {
return sourceFile.replace(/app\/templates\//, ''); // <%= yeoman.dist %>/scripts/
}
},
files: {
'<%= yeoman.dist %>/scripts/templates.js': [
'<%= yeoman.app %>/templates/**/*.hbs'
]
}
}
},
''는 스크립트 파일을 .tmp로 찾을 것입니다 '및'app'. – amiuhle
JSBIN 예제를 제공 할 수 있다면. 그것은 큰 도움이 될 것입니다. –