-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
48 lines (46 loc) · 1.14 KB
/
Copy pathwebpack.config.js
File metadata and controls
48 lines (46 loc) · 1.14 KB
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
var webpack = require('webpack');
var path = require('path');
require('babel-polyfill');
require('babel-loader');
module.exports = {
devtool: 'inline-source-map',
entry: [
'babel-polyfill',
'./scss/style.scss',
'./src/index.js'
// './src/server.js',
// 'webpack-dev-server/client?http://127.0.0.1:8080'
],
watch: true,
output: {
path: path.join(__dirname, 'public'),
filename: 'bundle.js'
},
resolve: {
modulesDirectories: ['node_modules', 'src'],
extensions: ['', '.js']
},
module: {
loaders: [
{
// Only run .js and .jsx files through Babel
test: /\.jsx?$/,
include: path.resolve(__dirname, "src"),
exclude: path.resolve(__dirname, "node_modules"),
loader: 'babel-loader',
query: {
presets: ['es2015', 'react'],
plugins: ['react-html-attrs', 'transform-class-properties', 'transform-runtime', 'transform-decorators-legacy']
}
},
{
test: /\.scss$/,
loaders: ["style", "css", "sass"]
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
]
};