This repository has been archived by the owner on Oct 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
85 lines (83 loc) · 1.95 KB
/
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
const webpack = require('webpack')
const path = require('path')
const config = {
entry: path.resolve(__dirname, 'app/App.js'),
output: {
path: path.resolve(__dirname, 'public/js/'),
publicPath: '/js/',
filename: 'bundle.js'
},
module: {
rules: [
{
test: /.jsx?$/,
exclude: [path.resolve(__dirname, 'node_modules')],
loader: 'babel-loader'
},
{
test: /\.styl$/,
exclude: /node_modules/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
sourceMap: process.env.NODE_ENV !== 'production'
}
},
'stylus-loader'
]
},
{
test: /\.css$/,
use: [
'style-loader',
{
loader: 'css-loader',
},
]
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
})
],
devServer: {
contentBase: path.resolve(__dirname, 'public'),
historyApiFallback: true,
compress: true,
open: false,
host: '0.0.0.0',
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers': '*',
'X-Frame-Options': 'ALLOW-FROM *',
},
proxy: {
'/Art': {
target: 'https://www.wilddream.net/',
secure: false,
changeOrigin: true,
},
'/Journal': {
target: 'https://www.wilddream.net/',
secure: false,
changeOrigin: true,
}
}
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'app'),
'@page': path.resolve(__dirname, 'app', 'page'),
'@comp': path.resolve(__dirname, 'app', 'component'),
'@util': path.resolve(__dirname, 'app', 'util'),
'@style': path.resolve(__dirname, 'app', 'style'),
'@const': path.resolve(__dirname, 'app', 'constant'),
},
modules: ['node_modules'],
}
}
module.exports = config