This repository has been archived by the owner on Aug 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
webpack.dev.js
68 lines (63 loc) · 2.14 KB
/
webpack.dev.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
62
63
64
65
66
67
68
const webpack = require('webpack');
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const path = require('path');
module.exports = merge(common, {
mode: 'development',
devtool: 'inline-source-map',
plugins:[
new webpack.HotModuleReplacementPlugin(),
],
devServer: {
//contentBase: './dist',
//contentBase: './',
overlay: {
errors: true,
warnings: false,
},
headers: {
'Access-Control-Allow-Origin': '*',
},
host: "dev.wue-theme-public",
port: 9200,
public: "dev.wue-theme-public:9200",
//bundle files:
publicPath: "/wp-content/themes/wuetheme/app/",
stats: 'errors-only',
https: true,
inline: true,
noInfo: true,
historyApiFallback: true,
hot: true,
open: true,
hotOnly: true,
disableHostCheck: true,
writeToDisk: true,
proxy: {
'/': {
target: "https://dev.wue-theme-public",
secure: false,
changeOrigin: true,
autoRewrite: true,
headers: {
'X-ProxiedBy-Webpack': true,
},
},
},
},
output: {
//custom filename structure without hashs
filename: '[name].bundle.js',
//The output directory as an server-internal absolute path:
path: path.resolve(__dirname, "wordpress/wp-content/themes/wuetheme/app"),
//relative path on the server publicly accessable:
publicPath: "https://dev.wue-theme-public:9200/wp-content/themes/wuetheme/app/",
//https://webpack.js.org/configuration/output#outputpublicpath:
//publicPath: 'https://cdn.example.com/assets/', // CDN (always HTTPS)
//publicPath: '//cdn.example.com/assets/', // CDN (same protocol)
//publicPath: '/assets/', // server-relative
//publicPath: 'assets/', // relative to HTML page
//publicPath: '../assets/', // relative to HTML page
//publicPath: '', // relative to HTML page (same directory)
},
});