reprogl

Форк
0
/
Gruntfile.js 
132 строки · 5.3 Кб
1
'use strict';
2

3
const sass = require('node-sass');
4

5
// docker-compose run nodejs su node
6

7
module.exports = function (grunt) {
8
    grunt.loadNpmTasks('grunt-contrib-concat');
9
    grunt.loadNpmTasks('grunt-contrib-cssmin');
10
    grunt.loadNpmTasks('grunt-contrib-uglify');
11
    grunt.loadNpmTasks('grunt-sass');
12

13
    grunt.initConfig({
14
        banner_format: '/* <%= pkg.name %> v<%= pkg.version %> --- <%= grunt.template.today("dd mmm yyyy HH:MM:ss o") %> */\n',
15
        pkg: grunt.file.readJSON('package.json'),
16
        sass: {
17
            options: {
18
                implementation: sass,
19
                sourceMap: false
20
            },
21
            dist: {
22
                files: {
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
        },
37
        concat: {
38
            css_main: {
39
                options: {
40
                    stripBanners: {
41
                        block: true
42
                    },
43
                    banner: '<%= banner_format %>'
44
                },
45
                src: [
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
                ],
58
                dest: 'public/assets/css/<%= pkg.name %>.css'
59
            },
60
            foundation_js: {
61
                src: [
62
                    'node_modules/foundation-sites/js/foundation/foundation.js',
63
                ],
64
                dest: 'public/assets/js/foundation.js'
65
            },
66
            oauth_js: {
67
                src: [
68
                    'node_modules/jquery/dist/jquery.js',
69
                    'public/assets/js/oauth.js',
70
                ],
71
                dest: 'public/assets/js/<%= pkg.name %>_oauth.js'
72
            },
73
            js: {
74
                options: {
75
                    stripBanners: {
76
                        block: true
77
                    },
78
                    banner: '<%= banner_format %>'
79
                },
80
                src: [
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
                ],
97
                dest: 'public/assets/js/<%= pkg.name %>.js'
98
            }
99
        },
100
        cssmin: {
101
            options: {
102
                shorthandCompacting: false,
103
                roundingPrecision: -1,
104
                format: 'keep-breaks',
105
                sourceMap: false
106
            },
107
            target: {
108
                files: {
109
                    'public/assets/css/<%= pkg.name %>_temp.min.css': ['<%= concat.css_main.dest %>']
110
                }
111
            }
112
        },
113
        uglify: {
114
            options: {
115
                output: {
116
                    ascii_only: true,
117
                    max_line_len: 160
118
                }
119
            },
120
            dist: {
121
                files: {
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

129
    grunt.registerTask('build', ['sass', 'concat', 'cssmin', 'uglify']);
130
    grunt.registerTask('style', ['sass', 'concat', 'cssmin']);
131
    grunt.registerTask('default', ['build']);
132
};
133

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.