-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathwebpack.config.js
More file actions
43 lines (41 loc) · 943 Bytes
/
webpack.config.js
File metadata and controls
43 lines (41 loc) · 943 Bytes
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
var CopyWebpackPlugin = require('copy-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var path = require('path')
module.exports = {
entry: './src/index.js',
devtool: 'source-map',
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
{
test: /\.(scss|css)$/,
loader: ExtractTextPlugin.extract("style-loader", ["css-loader", "postcss-loader", "sass-loader"]),
},
],
},
postcss: () => {
return [
require('autoprefixer')
];
},
devServer: {
port: 4000,
host: 'localhost',
inline: true,
info: false,
},
plugins: [
new CopyWebpackPlugin([
{ from: path.join(__dirname, 'src/index.html') },
]),
new ExtractTextPlugin('bundle.css', { allChunks: true }),
],
}