-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.development.js
50 lines (49 loc) · 1.31 KB
/
webpack.config.development.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const Dotenv = require('dotenv-webpack');
module.exports = {
devtool: 'eval',
devServer: {
historyApiFallback: true
},
entry: [
'webpack-hot-middleware/client',
path.join(__dirname, 'client/index')
],
output: {
path: __dirname,
filename: 'bundle.js',
publicPath: '/dist/'
},
// target: 'node',
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new ExtractTextPlugin("style.css"),
new Dotenv({
path: './.env', // if not simply .env
safe: false // lets load the .env.example file as well
})
],
module: {
loaders: [{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
include: __dirname,//path.join(__dirname, 'client')
query: {
presets: ['es2015', 'react', 'react-hmre']
}
},{
test: /\.json$/,
loader: 'json-loader'
},{
test: /\.scss$/,
loaders: ["style-loader", "css-loader", "sass-loader?config=otherSassLoaderConfig"]
//loaders: ["style",ExtractTextPlugin.extract('style', 'css!resolve-url!sass')]
},
{ test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' }
]
}
};