diff --git a/config/webpack.config.js b/config/webpack.config.js index 564c9dbae2b224d9b7ac6d5fead53b346afcadc1..4223e01a6625b9a5932af2be386c882bc2a02073 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -3,23 +3,39 @@ const HtmlWebpackPlugin = require('html-webpack-plugin'); const webpack = require('webpack'); const ExtractTextPlugin = require("extract-text-webpack-plugin"); +// devserver configuration +const HOST = process.env.HOST || 'localhost'; +const PORT = process.env.PORT || 3100; + module.exports = { entry: './src/index.js', output: { filename: 'bundle.js', path: path.join(process.cwd(), 'target/app') }, + devServer: { + historyApiFallback: true, + hot: false, + inline: true, + contentBase: false, + compress: true, + port: PORT, + host: HOST, + overlay: { + warnings: true, + errors: true, + }, + clientLogLevel: "warning", + }, module: { rules: [ { test: /\.css$/, use: ExtractTextPlugin.extract('css-loader') - }, - { + }, { test: /\.json$/, loader: 'json-loader' - }, - { + }, { test: /\.js$/, exclude: /(node_modules|bower_components)/, use: { @@ -28,19 +44,14 @@ module.exports = { presets: ['babel-preset-env'] } } - }, + } ] }, devtool: 'inline-source-map', plugins: [ new ExtractTextPlugin('styles.css'), new webpack.optimize.UglifyJsPlugin(), - new HtmlWebpackPlugin({ template: './index.html' }), - new webpack.ProvidePlugin({ - $: "jquery", - jQuery: "jquery", - d3: "d3", - _: "underscore", - }) + new HtmlWebpackPlugin({template: './index.html'}), + new webpack.ProvidePlugin({$: "jquery", jQuery: "jquery", d3: "d3", _: "underscore"}) ] }; diff --git a/index.html b/index.html index 61987dea5b479f9ccf408c56660dc6b37f2bcf4d..0b52978f70eaf78614fb6def3f51142026090a46 100644 --- a/index.html +++ b/index.html @@ -1,67 +1,74 @@ + - - + +
+ +
+
+
+
-