forked from grommet/grommet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
116 lines (110 loc) · 2.56 KB
/
gulpfile.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
var gulp = require('gulp');
var path = require('path');
var fs = require('fs');
var coveralls = require('gulp-coveralls');
var gulpUtils = require('./gulpfile-utils');
var opts = {
dist: path.resolve(__dirname, 'dist'),
copyAssets: [
'README.md',
{
asset: 'src/js/**',
babel: true
},
{
asset: 'src/scss/**',
dist: 'dist/scss/'
},
{
asset: 'src/utils/**',
dist: 'dist/utils/'
},
{
asset: 'src/img/**',
dist: 'dist/img/'
},
{
asset: 'bin/**',
dist: 'dist/bin/'
},
{
asset: 'templates/**',
dist: 'dist/templates/'
},
{
asset: 'examples/**',
dist: 'dist/examples/',
ignores: [
'node_modules/',
'dist/'
]
},
{
filename: 'package.json',
asset: JSON.stringify(gulpUtils.getPackageJSON(), null, 2)
},
{
asset: 'src/utils/gulp/.eslintrc',
dist: 'dist/utils/gulp/'
}
],
scssAssets: ['src/scss/**/*.scss'],
jsAssets: [
'src/js/**/*.js',
'src/utils/**/*.js',
'test/**/*.js',
'examples/cto-app-tuner/src/**/*.js',
'examples/server/*.js'
],
mainJs: 'src/js/index.js',
mainScss: 'src/scss/grommet-core/index.scss',
icons: {
source: 'src/img/icons',
destination: 'src/js/components/icons/base',
context: '../../../'
},
sync: {
hostname: 'grommet.io',
username: 'grommet',
remoteDestination: '/var/www/html/assets/' + gulpUtils.getPackageJSON().version
},
webpack: {
output: {
filename: 'grommet.min.js',
libraryTarget: 'var',
library: 'Grommet'
},
resolve: {
alias: {
'grommet': path.resolve(__dirname, 'src/js')
},
modulesDirectories: ['node_modules', 'src/js', 'src/scss']
},
externals: {
'react': 'React',
'react-dom': 'ReactDOM'
}
},
distPreprocess: ['generate-index-icons', 'dist-css'],
scsslint: true,
testPaths: [
'test/**/*.js'
]
};
require('./src/utils/gulp/gulp-tasks')(gulp, opts);
require('./gulpfile-grommet-dist')(gulp, opts);
require('./gulpfile-grommet-release')(gulp, opts);
gulp.task('coveralls', function() {
var lcovPath = './coverage/lcov.info';
fs.exists(lcovPath, function(exists) {
if (exists) {
gulp.src(lcovPath).pipe(coveralls());
} else {
console.error('Could not find lcov report file.');
process.exit(1);
}
});
});
gulp.task('dev', function() {
console.error('Running "gulp dev" at Grommet root folder is not supported. If you want to start the website, run "gulp dev" at docs folder');
});