-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.webpack.config.js
53 lines (46 loc) · 1.25 KB
/
base.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
47
48
49
50
51
52
53
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const output_directory = "build";
var plugins = [
new CleanWebpackPlugin([output_directory]),
new HtmlWebpackPlugin({
title: 'Sybon Admin',
template: 'index.template.ejs'
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
filename: 'vendor.js',
}),
];
module.exports = {
context: path.resolve(__dirname),
entry: {
vendor: ['react', 'react-dom', 'material-ui'],
app: ["./src/index.tsx"],
},
output: {
filename: "bundle.js",
path: __dirname + '/' + output_directory
},
resolve: {
extensions: [".ts", ".tsx", ".js", '.jsx', ".json"]
},
plugins: plugins,
module: {
rules: [
{
test: /\.tsx?$/,
use: [
'react-hot-loader/webpack', 'babel-loader', 'awesome-typescript-loader'
],
exclude: /node_modules/,
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
]
},
};