forked from davidmz/BetterFeed
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
66 lines (61 loc) · 1.97 KB
/
Copy pathbuild.js
File metadata and controls
66 lines (61 loc) · 1.97 KB
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
var webpack = require("webpack");
var fs = require('fs');
var head = fs.readFileSync("./src/user-js-head.txt", "utf8");
webpack({
entry: ['babel/polyfill', 'whatwg-fetch', './src/js/main.js'],
output: {
path: './build',
filename: 'better-feed.min.js'
},
module: {
loaders: [
{test: /\.less$/, loader: 'style-loader!css-loader!less-loader'},
{test: /\.js$/, exclude: /(node_modules|bower_components)/, loader: 'babel?cacheDirectory'}
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({})//,
//new webpack.ProvidePlugin({'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'})
]
}, function (err, stats) {
if (err !== null) console.log(err);
var jStats = stats.toJson();
if (jStats.errors.length > 0) jStats.errors.forEach(function (m) { console.log("ERR", m); });
if (jStats.warnings.length > 0) jStats.warnings.forEach(function (m) { console.log("WARN", m); });
});
webpack({
entry: ['babel/polyfill', './src/js/options.js'],
output: {
path: './build',
filename: 'options.min.js'
},
module: {
loaders: [
{test: /\.js$/, exclude: /(node_modules|bower_components)/, loader: 'babel?cacheDirectory'}
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({})
]
}, function (err, stats) { if (err !== null) console.log(err);});
webpack({
entry: './src/bootstrap.js',
output: {
path: './build',
filename: 'better-feed.user.js'
},
plugins: [
new webpack.optimize.UglifyJsPlugin({}),
new webpack.BannerPlugin(head, {raw: true})
]
}, function (err, stats) { if (err !== null) console.log(err);});
webpack({
entry: './src/js/site-boot.js',
output: {
path: './build',
filename: 'better-feed.site.js'
},
plugins: [
new webpack.optimize.UglifyJsPlugin({})
]
}, function (err, stats) { if (err !== null) console.log(err);});