-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.client.config.js
More file actions
43 lines (42 loc) · 1.03 KB
/
webpack.client.config.js
File metadata and controls
43 lines (42 loc) · 1.03 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
const path = require('path')
const BrowserSyncPlugin = require('browser-sync-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
entry: {
main: './src/client/index.js'
},
output: {
path: path.join(__dirname, '/dist/assets'),
filename: 'js/[name].js',
sourceMapFilename: 'js/[name].map'
},
target: 'web',
resolve: {
extensions: ['*', '.html', '.js'],
modules: ['node_modules']
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: ['babel-loader']
}
]
},
plugins: [
new HtmlWebpackPlugin({
filename: path.join(__dirname, '/dist/index.html'),
template: path.join(__dirname, '/src/client/utils/template/index.html')
}),
new BrowserSyncPlugin({
files: [
'./dist/*.html',
'./dist/js/*.js'
],
host: 'localhost',
port: 3000,
server: { baseDir: ['dist'] }
})
]
}