-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
82 lines (78 loc) · 1.85 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
const sass = require('node-sass');
module.exports = function(grunt) {
'use strict';
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
options: {
implementation: sass,
sourceMap: true,
outputStyle: 'compressed',
},
dist: {
files: {
// 'destination': 'source'
'css/redturtlegallery.css': 'sass/redturtlegallery.scss',
},
},
},
postcss: {
options: {
map: true,
processors: [
require('autoprefixer')({
browsers: ['last 2 versions', 'ie >= 11', 'iOS >= 6'],
}),
],
},
dist: {
src: 'css/*.css',
},
},
requirejs: {
'redturtle-gallery': {
options: {
baseUrl: './',
generateSourceMaps: true,
preserveLicenseComments: false,
paths: {
jquery: 'empty:',
},
wrapShim: true,
name: 'js/integration.js',
exclude: ['jquery'],
out: 'js/bundle-compiled.js',
optimize: 'none',
},
},
},
uglify: {
gallery: {
options: {
sourceMap: true,
sourceMapIncludeSources: false,
},
files: {
'js/redturtle-gallery-bundle-compiled.min.js': [
'js/bundle-compiled.js',
],
},
},
},
watch: {
styles: {
files: ['sass/**/*.scss'],
tasks: ['sass', 'postcss'],
},
scripts: {
files: ['./js/integration.js'],
tasks: ['requirejs', 'uglify'],
},
},
});
// CWD to theme folder
grunt.file.setBase('./src/redturtle/gallery/browser/static');
grunt.registerTask('compile', ['sass', 'postcss', 'requirejs', 'uglify']);
grunt.registerTask('default', ['watch']);
};