summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Van Doorn <vandoorn.nick@gmail.com>2017-05-12 17:50:14 -0700
committerNick Van Doorn <vandoorn.nick@gmail.com>2017-05-12 17:50:14 -0700
commite0359a93ff06fdd92e254d8110e0df0291511ebf (patch)
tree7402f7fa75c5088883413ecb187fd732fa014221
parenta53a55e946bff075be02d0d4539e05c5b09dd133 (diff)
Add sourcemap and url loader
-rw-r--r--config/webpack.config.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/config/webpack.config.js b/config/webpack.config.js
index eb7e56d..444df77 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -1,4 +1,5 @@
const path = require('path')
+const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
@@ -8,6 +9,7 @@ const BUILD_PATH = path.join(__dirname, '..', 'build', 'static')
const PUBLIC_PATH = path.join(__dirname, '..', 'public')
module.exports = {
+ devtool: 'source-map',
entry: './src/index.js',
output: {
filename: 'bundle.js',
@@ -15,7 +17,22 @@ module.exports = {
},
module: {
rules: [{
+ exclude: [
+ /\.html$/,
+ /\.(js|jsx)$/,
+ /\.css$/,
+ /\.json$/,
+ /\.svg$/
+ ],
+ loader: 'url',
+ query: {
+ limit: 10000,
+ name: 'static/media/[name].[hash:8].[ext]'
+ }
+ },
+ {
test: /\.(js|jsx)$/,
+ enforce: 'pre',
use: ['eslint-loader'],
include: SRC_PATH
},