OpenDroneMap-WebODM/webpack.config.js

77 wiersze
2.1 KiB
JavaScript
Czysty Zwykły widok Historia

let path = require("path");
let webpack = require('webpack');
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 = {
context: __dirname,
entry: {
// 'webpack-dev-server/client?http://localhost:3000',
// 'webpack/hot/only-dev-server',
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"
// publicPath: 'http://localhost:3000/app/static/app/bundles/', // Tell django to use this URL to load packages and not use STATIC_URL + bundle_name
2016-10-08 16:35:22 +00:00
},
plugins: [
// new webpack.HotModuleReplacementPlugin(),
// new webpack.NoErrorsPlugin(), // don't reload if there is an error
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: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
query: {
"plugins": [
'syntax-class-properties',
'transform-class-properties'
// 'react-hot-loader/babel'
],
2016-10-08 16:35:22 +00:00
presets: ['es2015', 'react']
}
},
{
2016-10-27 20:40:22 +00:00
test: /\.s?css$/,
loader: ExtractTextPlugin.extract('css!sass')
},
{
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: {
modulesDirectories: ['node_modules', 'bower_components'],
2017-01-02 23:08:09 +00:00
extensions: ['', '.js', '.jsx']
},
externals: {
2016-12-19 21:39:38 +00:00
// require("jquery") is external and available
// on the global let jQuery
2017-01-02 23:08:09 +00:00
"jquery": "jQuery"
2016-10-08 16:35:22 +00:00
}
}