This repository was archived by the owner on Jun 27, 2020. It is now read-only.
forked from StephenChou1017/react-big-scheduler
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack-dev.config.js
61 lines (60 loc) · 1.78 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
const path = require('path'),
webpack = require('webpack'),
HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: "development",
entry: {
//app: ['./src/App.tsx']
app: ['./example/bundle.tsx'],
vendor: ['react']
},
output: {
path: path.resolve(__dirname, 'lib'),
filename: 'js/[name].bundle.js'
},
devtool: 'source-map',
resolve: {
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx']
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
loader: 'ts-loader'
},
//{ enforce: "pre", test: /\.js$/, loader: "source-map-loader" },
{ test: /\.jsx$|\.es6$|\.js$/, loaders: ['babel-loader'], exclude: /node_modules/ },
{
test: /\.scss$|\.css$|\.less$/,
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
},
{
loader: 'sass-loader',
},
{
loader: 'less-loader',
options: {
javascriptEnabled: true,
},
},
],
},
{ test: /\.(jpe?g|png|gif)$/i, loader: 'url?limit=10000!img?progressive=true' },
]
},
plugins: [
new HtmlWebpackPlugin({ template: path.resolve(__dirname, 'example', 'index.html') }),
new webpack.HotModuleReplacementPlugin()
],
devServer: {
contentBase: path.join(__dirname, 'example'),
compress: false,
port: 9000,
hot: true
}
}