2019-06-08 17:12:12 +00:00
|
|
|
const webpack = require('webpack');
|
2016-10-11 17:42:17 +00:00
|
|
|
let path = require("path");
|
|
|
|
let BundleTracker = require('webpack-bundle-tracker');
|
|
|
|
let ExtractTextPlugin = require('extract-text-webpack-plugin');
|
|
|
|
let LiveReloadPlugin = require('webpack-livereload-plugin');
|
2016-10-08 16:35:22 +00:00
|
|
|
|
|
|
|
module.exports = {
|
2018-07-26 15:05:00 +00:00
|
|
|
mode: 'development',
|
2016-10-08 16:35:22 +00:00
|
|
|
context: __dirname,
|
|
|
|
|
2017-05-08 21:21:04 +00:00
|
|
|
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']
|
|
|
|
},
|
2016-10-08 16:35:22 +00:00
|
|
|
|
|
|
|
output: {
|
2016-10-11 17:42:17 +00:00
|
|
|
path: path.join(__dirname, './app/static/app/bundles/'),
|
|
|
|
filename: "[name]-[hash].js"
|
2016-10-08 16:35:22 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
plugins: [
|
2019-09-08 19:24:31 +00:00
|
|
|
new LiveReloadPlugin({appendScriptTag: true}),
|
2016-10-08 16:35:22 +00:00
|
|
|
new BundleTracker({filename: './webpack-stats.json'}),
|
2017-05-08 21:21:04 +00:00
|
|
|
new ExtractTextPlugin('css/[name]-[hash].css', {
|
2016-10-11 17:42:17 +00:00
|
|
|
allChunks: true
|
2019-06-08 17:12:12 +00:00
|
|
|
}),
|
|
|
|
new webpack.ProvidePlugin({
|
|
|
|
THREE: path.join(__dirname, './app/static/app/js/vendor/potree/three')
|
2016-10-11 17:42:17 +00:00
|
|
|
})
|
2016-10-08 16:35:22 +00:00
|
|
|
],
|
|
|
|
|
|
|
|
module: {
|
2017-07-18 18:14:59 +00:00
|
|
|
rules: [
|
2016-10-08 16:35:22 +00:00
|
|
|
{
|
|
|
|
test: /\.jsx?$/,
|
|
|
|
exclude: /(node_modules|bower_components)/,
|
2017-07-18 18:14:59 +00:00
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'babel-loader',
|
|
|
|
query: {
|
2018-07-25 19:11:42 +00:00
|
|
|
plugins: [
|
|
|
|
'@babel/syntax-class-properties',
|
|
|
|
'@babel/proposal-class-properties'
|
2017-07-18 18:14:59 +00:00
|
|
|
],
|
2018-07-25 19:11:42 +00:00
|
|
|
presets: [
|
|
|
|
'@babel/preset-env',
|
|
|
|
'@babel/preset-react'
|
|
|
|
]
|
2017-07-18 18:14:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2016-10-11 17:42:17 +00:00
|
|
|
},
|
|
|
|
{
|
2016-10-27 20:40:22 +00:00
|
|
|
test: /\.s?css$/,
|
2017-07-18 18:14:59 +00:00
|
|
|
use: ExtractTextPlugin.extract({
|
2019-07-19 02:20:39 +00:00
|
|
|
use: [
|
|
|
|
{ loader: 'css-loader' },
|
|
|
|
{
|
|
|
|
loader: 'sass-loader',
|
|
|
|
options: {
|
|
|
|
implementation: require("sass")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2017-07-18 18:14:59 +00:00
|
|
|
})
|
2016-11-09 21:13:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(png|jpg|jpeg|svg)/,
|
|
|
|
loader: "url-loader?limit=100000"
|
2016-12-19 21:39:38 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
// shaders
|
|
|
|
test: /\.(frag|vert|glsl)$/,
|
|
|
|
loader: 'raw-loader'
|
2016-10-08 16:35:22 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
resolve: {
|
2017-07-18 18:14:59 +00:00
|
|
|
modules: ['node_modules', 'bower_components'],
|
|
|
|
extensions: ['.js', '.jsx']
|
2016-10-11 17:42:17 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
externals: {
|
2016-12-19 21:39:38 +00:00
|
|
|
// require("jquery") is external and available
|
|
|
|
// on the global let jQuery
|
2018-02-09 17:38:42 +00:00
|
|
|
"jquery": "jQuery",
|
2018-03-29 18:25:20 +00:00
|
|
|
"SystemJS": "SystemJS",
|
2019-12-04 03:59:44 +00:00
|
|
|
"React": "React",
|
|
|
|
"ReactDOM": "ReactDOM"
|
2019-09-07 13:44:12 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
watchOptions: {
|
2019-11-05 20:47:29 +00:00
|
|
|
ignored: ['node_modules', './**/*.py'],
|
2019-09-07 13:44:12 +00:00
|
|
|
aggregateTimeout: 300,
|
|
|
|
poll: 1000
|
2016-10-08 16:35:22 +00:00
|
|
|
}
|
|
|
|
}
|