OpenDroneMap-WebODM/webpack.config.js

100 wiersze
2.4 KiB
JavaScript
Czysty Zwykły widok Historia

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');
2016-10-08 16:35:22 +00:00
module.exports = {
mode: 'development',
2016-10-08 16:35:22 +00:00
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']
},
2016-10-08 16:35:22 +00:00
output: {
path: path.join(__dirname, './app/static/app/bundles/'),
filename: "[name]-[hash].js"
2016-10-08 16:35:22 +00:00
},
plugins: [
new LiveReloadPlugin({appendScriptTag: true}),
2016-10-08 16:35:22 +00:00
new BundleTracker({filename: './webpack-stats.json'}),
new ExtractTextPlugin('css/[name]-[hash].css', {
allChunks: true
})
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: {
plugins: [
'@babel/syntax-class-properties',
'@babel/proposal-class-properties'
2017-07-18 18:14:59 +00:00
],
presets: [
'@babel/preset-env',
'@babel/preset-react'
]
2017-07-18 18:14:59 +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
})
},
{
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']
},
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",
"SystemJS": "SystemJS",
2020-06-04 16:34:34 +00:00
"THREE": "THREE",
2019-12-04 03:59:44 +00:00
"React": "React",
2020-12-14 17:43:16 +00:00
"ReactDOM": "ReactDOM",
"gettext": "gettext"
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
}
}