Skip to content

Commit 7b38f44

Browse files
author
kimobrian
committed
chore: Create webpack cconfig for development env
1 parent 8616a7c commit 7b38f44

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

webpack.config.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
const HtmlWebpackPlugin = require('html-webpack-plugin');
2+
const webpack = require('webpack');
3+
const ExtractTextPlugin = require("extract-text-webpack-plugin");
4+
const path = require('path');
5+
6+
module.exports = {
7+
devtool: 'source-map',
8+
entry: __dirname + "/app/app.js",
9+
output: {
10+
path: __dirname + '/dist',
11+
filename: 'bundle.js',
12+
publicPath: '/'
13+
},
14+
resolve: {
15+
extensions: ['.js', '.jsx']
16+
},
17+
devServer: {
18+
contentBase: "./dist",
19+
historyApiFallback: true,
20+
inline: true,
21+
hot: true,
22+
port: 7700,
23+
} ,
24+
module: {
25+
loaders: [
26+
{
27+
test: /\.jsx?$/, exclude: [/node_modules/, /bower_components/], loader: 'babel-loader'
28+
},
29+
{
30+
test: /\.css$/, loader: ExtractTextPlugin.extract(
31+
{
32+
fallback: 'style-loader',
33+
use: ['css-loader', 'sass-loader']
34+
}
35+
)
36+
}
37+
]
38+
},
39+
plugins: [
40+
new HtmlWebpackPlugin({
41+
hash: true,
42+
template: __dirname + "/app/index.tmpl.html",
43+
inject: 'body'
44+
}),
45+
new webpack.BannerPlugin("O'Brian Webpack Setup. Inc"),
46+
new webpack.HotModuleReplacementPlugin(),
47+
new ExtractTextPlugin("[name]-[hash].css"),
48+
new webpack.NamedModulesPlugin()
49+
]
50+
};

0 commit comments

Comments
 (0)