-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwebpack.config.js
More file actions
87 lines (83 loc) · 2.95 KB
/
webpack.config.js
File metadata and controls
87 lines (83 loc) · 2.95 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
'use strict';
var webpack = require('webpack');
var path = require('path');
// TODO: At some point factor this better
var progressPlugin = (function () {
var chars = 0;
var lastState;
var lastStateTime;
return new webpack.ProgressPlugin(function (percentage, msg) {
var state = msg;
if (percentage < 1) {
percentage = Math.floor(percentage * 100);
msg = percentage + '% ' + msg;
if (percentage < 100) {
msg = ' ' + msg;
}
if (percentage < 10) {
msg = ' ' + msg;
}
}
if (percentage > 0) {
for (; chars > msg.length; chars--) {
process.stderr.write('\b \b');
}
chars = msg.length;
for (var i = 0; i < chars; i++) {
process.stderr.write('\b');
}
process.stderr.write(msg);
}
});
})();
module.exports = {
entry: 'NOT SET HERE',
output: {
path: 'NOT SET HERE',
filename: './[name].js',
chunkFilename: './[id].chunk.js'
},
resolve: {
extensions: ['', '.js', '.jsx', '.ts', '.tsx', '.json'],
modulesDirectories: ['node_modules'],
alias: {
'glimpse': path.resolve(__dirname, './src/glimpse.js'),
'shell': path.resolve(__dirname, './src/shell'),
'request': path.resolve(__dirname, './src/request'),
'fake': path.resolve(__dirname, './fake/fake.js'),
'diagnostics': path.resolve(__dirname, './diagnostics/diagnostics.js'),
'react': require.resolve('react/addons'),
'lib': path.resolve(__dirname, './src/lib/'),
'assets': path.resolve(__dirname, './assets/'),
'event-source': require.resolve('event-source-polyfill'),
'highlight.js': path.resolve(__dirname, './src/lib/modules/glimpse-highlight.js')
}
},
module: {
loaders: [
{ test: /react/, loader: 'expose?React' },
{ test: /\.css$/, loader: 'style!css!autoprefixer?browsers=last 2 version' },
{ test: /\.scss$/, loader: 'style!css!autoprefixer?browsers=last 2 version!sass?includePaths[]=' + (path.resolve(__dirname, './node_modules/bootstrap-sass/assets/stylesheets/')) },
{ test: /\.jsx$/, loader: 'jsx-loader?insertPragma=React.DOM' },
{ test: /event-source/, loader: 'imports?this=>window!exports?EventSource=EventSource'},
{ test: /\.tsx|.ts$/, loader: 'ts'},
{ test: /\.woff|\.woff2$/, loader: 'file-loader'}
]
},
plugins: [
new webpack.DefinePlugin({
DIAGNOSTICS: true,
FAKE_SERVER: false,
DEV_TOOLS: false
}),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
progressPlugin
],
log: {
colors: true,
hash: true,
timings: true,
assets: true,
chunkModules: false
}
};