OpenDroneMap-WebODM/webpack.config.js

82 wiersze
1.9 KiB
JavaScript
Czysty Zwykły widok Historia

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: 'production',
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(),
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({
use: 'css-loader!sass-loader'
})
},
{
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",
"React": "React"
2016-10-08 16:35:22 +00:00
}
}