diff options
author | Nick Van Doorn <vandoorn.nick@gmail.com> | 2017-05-12 17:50:14 -0700 |
---|---|---|
committer | Nick Van Doorn <vandoorn.nick@gmail.com> | 2017-05-12 17:50:14 -0700 |
commit | e0359a93ff06fdd92e254d8110e0df0291511ebf (patch) | |
tree | 7402f7fa75c5088883413ecb187fd732fa014221 /config | |
parent | a53a55e946bff075be02d0d4539e05c5b09dd133 (diff) |
Add sourcemap and url loader
Diffstat (limited to 'config')
-rw-r--r-- | config/webpack.config.js | 17 |
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 }, |