Skip to content

Commit 8070dc0

Browse files
committed
more config changes
1 parent d6ded38 commit 8070dc0

File tree

1 file changed

+112
-104
lines changed

1 file changed

+112
-104
lines changed

webpack/webpack.dev.js

+112-104
Original file line numberDiff line numberDiff line change
@@ -12,119 +12,127 @@ const commonConfig = require('./webpack.common.js');
1212

1313
const ENV = 'development';
1414

15-
module.exports = (options) => webpackMerge(commonConfig({
16-
env: ENV
17-
}), {
18-
devtool: 'cheap-module-source-map', // https://reactjs.org/docs/cross-origin-errors.html
19-
mode: ENV,
20-
entry: [
21-
'./src/main/webapp/app/index',
22-
],
23-
output: {
24-
path: utils.root('target/classes/static/'),
25-
filename: 'app/[name].bundle.js',
26-
chunkFilename: 'app/[id].chunk.js'
27-
},
28-
module: {
29-
rules: [
30-
{
31-
test: /\.module\.scss$/,
32-
use:[
33-
'style-loader',
15+
module.exports = options =>
16+
webpackMerge(
17+
commonConfig({
18+
env: ENV,
19+
}),
20+
{
21+
devtool: 'cheap-module-source-map', // https://reactjs.org/docs/cross-origin-errors.html
22+
mode: ENV,
23+
entry: ['./src/main/webapp/app/index'],
24+
output: {
25+
path: utils.root('target/classes/static/'),
26+
filename: 'app/[name].bundle.js',
27+
chunkFilename: 'app/[id].chunk.js',
28+
},
29+
module: {
30+
rules: [
3431
{
35-
loader:'css-loader',
36-
options: {
37-
modules: {
38-
localIdentName:'[name]__[local]__[hash:base64:5]'
32+
test: /\.module\.scss$/,
33+
use: [
34+
'style-loader',
35+
{
36+
loader: 'css-loader',
37+
options: {
38+
modules: {
39+
localIdentName: '[name]__[local]__[hash:base64:5]',
40+
},
41+
importLoaders: 2,
42+
},
3943
},
40-
importLoaders:2
41-
}
44+
'sass-loader',
45+
utils.sassResourcesLoader,
46+
],
4247
},
43-
'sass-loader',
44-
utils.sassResourcesLoader
45-
]
46-
48+
{
49+
test: /\.(sa|sc|c)ss$/,
50+
exclude: /\.module\.scss$/,
51+
use: [
52+
'style-loader',
53+
'css-loader',
54+
'postcss-loader',
55+
{
56+
loader: 'sass-loader',
57+
options: { sourceMap: true },
58+
},
59+
utils.sassResourcesLoader,
60+
],
61+
},
62+
],
4763
},
48-
{
49-
test: /\.(sa|sc|c)ss$/,
50-
exclude: /\.module\.scss$/,
51-
use: ['style-loader', 'css-loader', 'postcss-loader', {
52-
loader: 'sass-loader',
53-
options: { sourceMap: true }
64+
devServer: {
65+
stats: options.stats,
66+
hot: true,
67+
contentBase: './target/classes/static/',
68+
proxy: [
69+
{
70+
context: [
71+
'/api',
72+
'/services',
73+
'/management',
74+
'/swagger-resources',
75+
'/v2/api-docs',
76+
'/h2-console',
77+
'/auth',
78+
],
79+
target: `http${options.tls ? 's' : ''}://localhost:9090`,
80+
secure: false,
81+
changeOrigin: options.tls,
5482
},
55-
utils.sassResourcesLoader
56-
]
57-
}
58-
]
59-
},
60-
devServer: {
61-
stats: options.stats,
62-
hot: true,
63-
contentBase: './target/classes/static/',
64-
proxy: [{
65-
context: [
66-
'/api',
67-
'/services',
68-
'/management',
69-
'/swagger-resources',
70-
'/v2/api-docs',
71-
'/h2-console',
72-
'/auth'
73-
],
74-
target: `http${options.tls ? 's' : ''}://localhost:9090`,
75-
secure: false,
76-
changeOrigin: options.tls
77-
}],
78-
watchOptions: {
79-
ignored: /node_modules/
80-
},
81-
https: options.tls,
82-
historyApiFallback: {
83-
disableDotRule: true
84-
}
85-
},
86-
stats: process.env.JHI_DISABLE_WEBPACK_LOGS ? 'none' : options.stats,
87-
plugins: [
88-
process.env.JHI_DISABLE_WEBPACK_LOGS
89-
? null
90-
: new SimpleProgressWebpackPlugin({
91-
format: options.stats === 'minimal' ? 'compact' : 'expanded'
92-
}),
93-
new FriendlyErrorsWebpackPlugin(),
94-
new BrowserSyncPlugin({
95-
https: options.tls,
96-
host: 'localhost',
97-
port: 9000,
98-
proxy: {
99-
target: `http${options.tls ? 's' : ''}://localhost:9060`,
100-
proxyOptions: {
101-
changeOrigin: false //pass the Host header to the backend unchanged https://github.com/Browsersync/browser-sync/issues/430
102-
}
83+
],
84+
watchOptions: {
85+
ignored: /node_modules/,
86+
},
87+
https: options.tls,
88+
historyApiFallback: {
89+
disableDotRule: true,
90+
},
10391
},
104-
socket: {
105-
clients: {
106-
heartbeatTimeout: 60000
107-
}
108-
}
109-
/*
92+
stats: process.env.JHI_DISABLE_WEBPACK_LOGS ? 'none' : options.stats,
93+
plugins: [
94+
process.env.JHI_DISABLE_WEBPACK_LOGS
95+
? null
96+
: new SimpleProgressWebpackPlugin({
97+
format: options.stats === 'minimal' ? 'compact' : 'expanded',
98+
}),
99+
new FriendlyErrorsWebpackPlugin(),
100+
new BrowserSyncPlugin(
101+
{
102+
https: options.tls,
103+
host: 'localhost',
104+
port: 9000,
105+
proxy: {
106+
target: `http${options.tls ? 's' : ''}://localhost:9095`,
107+
proxyOptions: {
108+
changeOrigin: false, //pass the Host header to the backend unchanged https://github.com/Browsersync/browser-sync/issues/430
109+
},
110+
},
111+
socket: {
112+
clients: {
113+
heartbeatTimeout: 60000,
114+
},
115+
},
116+
/*
110117
,ghostMode: { // uncomment this part to disable BrowserSync ghostMode; https://github.com/jhipster/generator-jhipster/issues/11116
111118
clicks: false,
112119
location: false,
113120
forms: false,
114121
scroll: false
115122
} */
116-
}, {
117-
reload: false
118-
}),
119-
new webpack.NamedModulesPlugin(),
120-
new webpack.HotModuleReplacementPlugin(),
121-
new writeFilePlugin(),
122-
new webpack.WatchIgnorePlugin([
123-
utils.root('src/test'),
124-
]),
125-
new WebpackNotifierPlugin({
126-
title: 'OncoKB',
127-
contentImage: path.join(__dirname, 'logo-oncokb.png')
128-
})
129-
].filter(Boolean)
130-
});
123+
},
124+
{
125+
reload: false,
126+
}
127+
),
128+
new webpack.NamedModulesPlugin(),
129+
new webpack.HotModuleReplacementPlugin(),
130+
new writeFilePlugin(),
131+
new webpack.WatchIgnorePlugin([utils.root('src/test')]),
132+
new WebpackNotifierPlugin({
133+
title: 'OncoKB',
134+
contentImage: path.join(__dirname, 'logo-oncokb.png'),
135+
}),
136+
].filter(Boolean),
137+
}
138+
);

0 commit comments

Comments
 (0)