forked from OpenDroneMap/WebODM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
98 lines (90 loc) · 2.31 KB
/
webpack.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
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
88
89
90
91
92
93
94
95
96
97
98
const webpack = require('webpack');
let path = require("path");
let BundleTracker = require('webpack-bundle-tracker');
let ExtractTextPlugin = require('extract-text-webpack-plugin');
let LiveReloadPlugin = require('webpack-livereload-plugin');
module.exports = {
mode: 'development',
context: __dirname,
entry: {
main: ['./app/static/app/js/main.jsx'],
Console: ['./app/static/app/js/Console.jsx'],
Dashboard: ['./app/static/app/js/Dashboard.jsx'],
MapView: ['./app/static/app/js/MapView.jsx'],
ModelView: ['./app/static/app/js/ModelView.jsx']
},
output: {
path: path.join(__dirname, './app/static/app/bundles/'),
filename: "[name]-[hash].js"
},
plugins: [
new LiveReloadPlugin({appendScriptTag: true}),
new BundleTracker({filename: './webpack-stats.json'}),
new ExtractTextPlugin('css/[name]-[hash].css', {
allChunks: true
})
],
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
use: [
{
loader: 'babel-loader',
query: {
plugins: [
'@babel/syntax-class-properties',
'@babel/proposal-class-properties'
],
presets: [
'@babel/preset-env',
'@babel/preset-react'
]
}
}
],
},
{
test: /\.s?css$/,
use: ExtractTextPlugin.extract({
use: [
{ loader: 'css-loader' },
{
loader: 'sass-loader',
options: {
implementation: require("sass")
}
}
]
})
},
{
test: /\.(png|jpg|jpeg|svg)/,
loader: "url-loader?limit=100000"
},
{
// shaders
test: /\.(frag|vert|glsl)$/,
loader: 'raw-loader'
}
]
},
resolve: {
modules: ['node_modules', 'bower_components'],
extensions: ['.js', '.jsx']
},
externals: {
// require("jquery") is external and available
// on the global let jQuery
"jquery": "jQuery",
"SystemJS": "SystemJS",
"React": "React",
"ReactDOM": "ReactDOM"
},
watchOptions: {
ignored: ['node_modules', './**/*.py'],
aggregateTimeout: 300,
poll: 1000
}
}