-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack-base-config.js
58 lines (57 loc) · 1.56 KB
/
webpack-base-config.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
var path = require('path');
var webpack = require('webpack');
module.exports = {
context: __dirname,
entry: {
'app': './src/index.js',
'reporttable': './src/plugin.js',
},
devtool: 'source-map',
output: {
path: __dirname + '/build',
filename: '[name].js',
},
module: {
loaders: [
{
test: /\.js$/,
include: [
path.resolve(__dirname, 'src/'),
/@dhis2\/d2-ui-rich-text/,
],
loader: 'babel',
query: {
cacheDirectory: true,
presets: ['es2015', 'stage-2'],
},
},
{
test: /\.css$/,
loader: 'style-loader!css-loader',
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
loaders: [
'url-loader?limit=8192'
]
},
{
test: /\.json$/,
loader: 'json-loader',
},
],
},
plugins: [
// Plugins to extend webpack functionality (https://webpack.github.io/docs/plugins.html)
/* Example that provides `fetch` as a global variable
new webpack.ProvidePlugin({
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
})
*/
//new webpack.ProvidePlugin({
//$: "jquery",
//jQuery: "jquery",
//"window.jQuery": "jquery"
//}),
],
};