-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGruntfile.js
81 lines (74 loc) · 1.51 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
/* eslint-env node */
'use strict';
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
module.exports = function (grunt) {
require('webpack');
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
grunt.registerTask('ci', ['eslint', 'karma:ci']);
grunt.initConfig({
eslint: {
target: ['Gruntfile.js', 'karma.conf.js', 'js', 'test']
},
karma: {
ci: {
configFile: 'karma.conf.js',
background: false,
singleRun: true,
browsers: ['PhantomJS']
},
unit: {
configFile: 'karma.conf.js',
background: true,
browsers: ['PhantomJS']
},
autowatch: {
configFile: 'karma.conf.js',
autoWatch: true,
browsers: ['PhantomJS']
}
},
watch: {
scripts: {
files: ['js/**/*.js', 'test/**/*.js'],
tasks: ['eslint', 'karma:autowatch'],
options: {
spawn: false
}
}
},
jsdoc: {
dist: {
src: ['README.md', 'js/*.js'],
options: {
destination: 'doc',
template: 'node_modules/ink-docstrap/template'
}
}
},
webpack: {
bundle: {
context: __dirname,
entry: ['./js/PluginAPI.js'],
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'umd',
library: 'PluginAPI'
},
externals: {
jquery: 'jQuery',
pm: 'pm'
},
devtool: 'source-map',
plugins: [
new CopyWebpackPlugin([{
from: './js/vendors/jquery.postmessage.js',
to: 'jquery.postmessage.js'
}])
]
}
}
});
};