Skip to content

Instantly share code, notes, and snippets.

@hugosolar
Last active August 18, 2022 17:25
Show Gist options
  • Save hugosolar/0fdc1300865a42e3c232 to your computer and use it in GitHub Desktop.
Save hugosolar/0fdc1300865a42e3c232 to your computer and use it in GitHub Desktop.
Gruntfile for Ember JS app
* significa que lo genera Grunt
------------------------------------
.
|-- Gruntfile.js ( el de arriba)
|-- css
| |-- style.css (development *)
| `-- style.min.css ( production * )
|-- font -> ../../framework/font
|-- img -> ../../framework/img
|-- index.html
|-- js
| |-- app (este directorio contiene toda la modularización del app de ember)
| | |-- app-init.js
| | |-- components
| | | `-- beneficiario-ubicacion.js
| | |-- controllers
| | | |-- application.js
| | | |-- atencion-medica.js
| | | |-- index.js
| | | `-- welcome-box.js
| | |-- helpers
| | | `-- stringify.js
| | |-- models
| | | `-- atencion.js
| | |-- router.js
| | |-- routes
| | | |-- atencion-medica.js
| | | |-- detalle.js
| | | |-- index.js
| | | `-- ultimas.js
| | |-- store.js
| | |-- templates
| | | |-- _opciones-servicios-dentales.hbs
| | | |-- application.hbs
| | | |-- atencion-medica.hbs
| | | |-- breadcrumb.hbs
| | | |-- buscar.hbs
| | | |-- components
| | | | |-- actualizar-datos.hbs
| | | | |-- beneficiario-ubicacion.hbs
| | | | `-- header-bono-web.hbs
| | | |-- detalle.hbs
| | | |-- footer.hbs
| | | |-- index.hbs
| | | |-- submit-button.hbs
| | | `-- ultimas.hbs
| | `-- views
| | |-- breadcrumb.js
| | |-- footer.js
| | |-- submit-button.js
| | `-- welcome-box.js
| |-- app.js (el app compilado *)
| |-- libs.js ( las librerias compiladas: ember-data, ember, bootstrap, etc *)
| |-- script.js ( el script de bono web )
| `-- templates.js ( Los templates handlebars compilados * )
|-- less
| |-- bonoweb.less
| |-- bootstrap -> ../../../framework/bower_components/bootstrap/less
| |-- consalud -> ../../../framework/less/consalud
| |-- extend -> ../../../framework/less/extend/
| `-- style.less
|-- package.json
module.exports = function( grunt ){
grunt.initConfig({
less: {
development: {
files: {
"css/style.css": "less/style.less"
}
},
production: {
options: {
compress: true,
yuicompress: true,
optimization: 2
},
files: {
"css/style.min.css": "less/style.less"
}
}
},
watch: {
styles: {
options: {
nospawn: true
},
files: [ "less/*.less", "less/*/*.less", "../../framework/bower_components/bootstrap/less/*.less" ],
tasks: [ "less" ]
},
emberTemplates: {
files: 'js/app/templates/**/*.hbs',
tasks: ['emberTemplates']
},
concat: {
files: ['js/**/*.js', '!js/app.js', '!js/libs.js', '!js/templates.js'],
tasks: ['concat']
}
},
emberTemplates: {
compile: {
options: {
templateBasePath: /js\/app\/templates\//
},
files: {
'js/templates.js': 'js/app/templates/**/*.hbs'
}
}
},
concat: {
libs: {
src: [
'../../framework/bower_components/jquery/dist/jquery.min.js',
'../../framework/bower_components/handlebars/handlebars.min.js',
'../../framework/bower_components/ember/ember.min.js',
'../../framework/bower_components/ember-data/ember-data.min.js',
'../../framework/bower_components/moment/moment.js',
'../../framework/bower_components/bootstrap/dist/js/bootstrap.min.js',
'../../framework/js/plugins/jquery-heights.js'
],
dest: 'js/libs.js'
},
app: {
src: 'js/app/**/*.js',
dest: 'js/app.js'
}
},
});
// load grunt plugins
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-ember-templates');
// register tasks
grunt.registerTask("default", ['watch', 'less', 'concat', 'emberTemplates']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment