-
Notifications
You must be signed in to change notification settings - Fork 5
/
Gruntfile.js
64 lines (61 loc) · 1.72 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
var webpack = require('webpack');
module.exports = function (grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
files: [
'Gruntfile.js',
'karma.conf.js',
'src/**/*.js',
'spec/**/*.js'
]
},
clean: {
build: ['./dist'],
tmp: ['tmp']
},
karma: {
unit: {
configFile: 'karma.conf.js'
}
},
webpack: {
build: {
entry: './src/module.js',
output: {
library: 'js360',
libraryTarget: 'umd',
path: __dirname,
filename: 'dist/js360.min.js',
},
externals: {
'Rx': 'Rx'
},
resolve: {
extensions: ['', '.js']
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
],
module: {
loaders: [{
test: /.js$/,
loader: 'babel-loader'
}]
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-webpack-without-server');
grunt.registerTask('build', ['clean', 'jshint', 'karma', 'webpack', 'clean:tmp']);
grunt.registerTask('test', ['jshint', 'karma']);
};