reprogl
/
Gruntfile.js
132 строки · 5.3 Кб
1'use strict';2
3const sass = require('node-sass');4
5// docker-compose run nodejs su node
6
7module.exports = function (grunt) {8grunt.loadNpmTasks('grunt-contrib-concat');9grunt.loadNpmTasks('grunt-contrib-cssmin');10grunt.loadNpmTasks('grunt-contrib-uglify');11grunt.loadNpmTasks('grunt-sass');12
13grunt.initConfig({14banner_format: '/* <%= pkg.name %> v<%= pkg.version %> --- <%= grunt.template.today("dd mmm yyyy HH:MM:ss o") %> */\n',15pkg: grunt.file.readJSON('package.json'),16sass: {17options: {18implementation: sass,19sourceMap: false20},21dist: {22files: {23'public/assets/css/foundation.css': 'public/assets/sass/foundation.scss',24'public/assets/css/style.css': 'public/assets/sass/style.scss',25'public/assets/css/menu.css': 'public/assets/sass/menu.scss',26'public/assets/css/post.css': 'public/assets/sass/post.scss',27'public/assets/css/select.css': 'public/assets/sass/select.scss',28'public/assets/css/comments.css': 'public/assets/sass/comments.scss',29'public/assets/css/profile.css': 'public/assets/sass/profile.scss',30'public/assets/css/pygments.css': 'public/assets/sass/pygments.scss',31'public/assets/css/errors.css': 'public/assets/sass/errors.scss',32'public/assets/css/glyphicons.css': 'public/assets/sass/glyphicons.scss',33'public/assets/css/login.css': 'public/assets/sass/login.scss',34}35}36},37concat: {38css_main: {39options: {40stripBanners: {41block: true42},43banner: '<%= banner_format %>'44},45src: [46'node_modules/normalize.css/normalize.css',47'public/assets/css/foundation.css',48'node_modules/magnific-popup/dist/magnific-popup.css',49'public/assets/css/glyphicons.css',50'public/assets/css/style.css',51'public/assets/css/pygments.css',52'public/assets/css/menu.css',53'public/assets/css/select.css',54'public/assets/css/post.css',55'public/assets/css/comments.css',56'public/assets/css/profile.css',57],58dest: 'public/assets/css/<%= pkg.name %>.css'59},60foundation_js: {61src: [62'node_modules/foundation-sites/js/foundation/foundation.js',63],64dest: 'public/assets/js/foundation.js'65},66oauth_js: {67src: [68'node_modules/jquery/dist/jquery.js',69'public/assets/js/oauth.js',70],71dest: 'public/assets/js/<%= pkg.name %>_oauth.js'72},73js: {74options: {75stripBanners: {76block: true77},78banner: '<%= banner_format %>'79},80src: [81'node_modules/foundation-sites/js/vendor/modernizr.js',82'node_modules/jquery/dist/jquery.js',83'<%= concat.foundation_js.dest %>',84'public/assets/js/vendors/headroom.js',85'public/assets/js/vendors/jquery.headroom.js',86'public/assets/js/vendors/reading-time.js',87'public/assets/js/vendors/imagesloaded.js',88'public/assets/js/vendors/nice-scroll.js',89'public/assets/js/vendors/shuffle.js',90'node_modules/magnific-popup/dist/jquery.magnific-popup.js',91'public/assets/js/vendors/select-fx.js',92'public/assets/js/vendors/velocity.js',93'public/assets/js/anima.js',94'public/assets/js/comments.js',95'public/assets/js/profile.js',96],97dest: 'public/assets/js/<%= pkg.name %>.js'98}99},100cssmin: {101options: {102shorthandCompacting: false,103roundingPrecision: -1,104format: 'keep-breaks',105sourceMap: false106},107target: {108files: {109'public/assets/css/<%= pkg.name %>_temp.min.css': ['<%= concat.css_main.dest %>']110}111}112},113uglify: {114options: {115output: {116ascii_only: true,117max_line_len: 160118}119},120dist: {121files: {122'public/assets/js/<%= pkg.name %>_oauth.min.js': ['<%= concat.oauth_js.dest %>'],123'public/assets/js/<%= pkg.name %>_temp.min.js': ['<%= concat.js.dest %>']124}125}126}127});128
129grunt.registerTask('build', ['sass', 'concat', 'cssmin', 'uglify']);130grunt.registerTask('style', ['sass', 'concat', 'cssmin']);131grunt.registerTask('default', ['build']);132};133