-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
46 lines (44 loc) · 1.4 KB
/
webpack.config.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
const path = require('path')
var webpack = require("webpack")
var ExtractTextPlugin = require("extract-text-webpack-plugin")
var UglifyJsPlugin = require('uglifyjs-webpack-plugin')
module.exports = {
entry: [
'./src/main.jsx'
],
output: {
path: __dirname + '/dist/',
filename: 'bundle.js',
publicPath: '/dist/'
},
devServer: {
port: '8080',
hot: true,
inline: true,
progress: true
},
resolve: {
extensions: [".js", ".jsx"]
},
module: {
loaders:[
{ test: /\.jsx$/, exclude: /node_modules/, loader: 'babel-loader'},
{ test: /\.json$/, loader: 'json-loader'},
// // { test: /\.pug$/, loader: 'pug' },
// {test: /\.css$/, loaders: ['style-loader', 'css-loader']},
// { test: /\.sass$/, loaders: ['style-loader', 'css-loader', 'sass-loader']},
// { test: /\.scss$/, loader: ExtractTextPlugin.extract('style-loader','css-loader!sass-loader')},
{ test: /\.scss$/, loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader!sass-loader', })
},
{ test: /\.svg$/, loader: 'file-loader'}
]},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new ExtractTextPlugin("bundle.css", {allChunks: true})
],
node: {
fs: "empty"
}
}