-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.dev.config.js
72 lines (63 loc) · 2.25 KB
/
webpack.dev.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// 'use strict';
// var path = require('path');
// var ExtractTextPlugin = require('extract-text-webpack-plugin');
// var autoprefixer = require('autoprefixer');
// var webpack = require('webpack');
// var HtmlWebpackPlugin = require('html-webpack-plugin');
// module.exports = {
// devtool: 'eval',
// entry: {
// 'main': path.join(__dirname, 'client', 'js', 'index.js'),
// 'style': path.join(__dirname, 'client', 'css', 'style.scss')
// },
// output: {
// path: path.join(__dirname, 'client', 'build'),
// filename: '[name].js',
// publicPath: '/'
// },
// module: {
// loaders: [
// { test: /\.js$/, loader: 'babel-loader', exclude: /(node_modules|bower_components)/, plugins: ['transform-runtime']},
// { test: /\.scss$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader!sass-loader')},
// { test: /\.css$/, loader: "style-loader!css-loader" },
// { test: /\.html$/, loader: 'html-loader'},
// { test: /\.png$/, loader: 'file' },
// { test: /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/, loader: 'file'}
// ]
// },
// plugins: [
// new ExtractTextPlugin('[name].css')
// ],
// postcss: function () {
// return [autoprefixer];
// }
// };
const path = require('path')
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
devtool: 'eval',
entry: [
'webpack-hot-middleware/client',
'./client/index.js'
],
output: {
path: path.join(__dirname, 'build'),
filename: 'bundle.js',
publicPath: '/build/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
module: {
loaders: [
{ test: /\.js?$/,loader: 'babel',exclude: /node_modules/ },
{ test: /\.scss$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader!autoprefixer-loader!postcss-loader!sass-loader')},
{ test: /\.png$/, loader: 'file' },
{ test: /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/, loader: 'file'},
{ test: /\.html$/, loader: 'html-loader'},
{ test: /\.css$/, loader: "style-loader!css-loader" }
]
}
}