-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
executable file
·77 lines (66 loc) · 1.97 KB
/
webpack.config.js
File metadata and controls
executable file
·77 lines (66 loc) · 1.97 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
var path = require('path');
var webpack = require('webpack');
// const FileManagerPlugin = require('filemanager-webpack-plugin');
module.exports = {
entry: [
'./src/index.js',
],
output: {
path: path.join(__dirname, 'build'),
// path: __dirname,
filename: 'reacting.js',
},
plugins:
[
new webpack.LoaderOptionsPlugin({
debug: true
}),
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin(),
// new webpack.NoErrorsPlugin(),
// new FileManagerPlugin({
// onEnd: [
// {
// copy: [
// //目录是相对于执行npm run demo的根目录,而不是webpack.config.js的位置
// {source: "./demo/build/bundle.js", destination: "./docs/bundle.js"}
// ]
// },
// ]
// }),
],
// resolve: {
//
// // 可以替换初始模块路径,此替换路径通过使用 resolve.alias 配置选项来创建一个别名
// alias: {
// 'react': path.join(__dirname, '..', 'src/index.js'),
// },
// },
module:
{
rules: [{
test: /\.(js|jsx)$/,
include: [
__dirname,
path.join(__dirname, 'src'),
path.join(__dirname, 'demo'),
],
use: {
loader: 'babel-loader',
},
}],
}
,
devtool: 'inline-source-map',
devServer:
{
// contentBase: './',
contentBase: path.join(__dirname, 'public'),
port: 8999,
hot: true,
inline: true,
publicPath: '/',
watchContentBase: true,
}
}
;