@nitro-web/webpack 0.0.179 → 0.0.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/types/webpack.config.d.ts +1 -1
- package/webpack.config.js +5 -5
package/package.json
CHANGED
package/webpack.config.js
CHANGED
|
@@ -16,7 +16,7 @@ import postcssImport from 'postcss-import'
|
|
|
16
16
|
import postcssNested from 'postcss-nested'
|
|
17
17
|
import postcssFor from 'postcss-for'
|
|
18
18
|
import { createRequire } from 'module'
|
|
19
|
-
import { getDirectories } from 'nitro-web/util'
|
|
19
|
+
import { getDirectories, getPortServer } from 'nitro-web/util'
|
|
20
20
|
|
|
21
21
|
const _require = createRequire(import.meta.url)
|
|
22
22
|
const isBuild = process.env.NODE_ENV == 'production'
|
|
@@ -40,7 +40,7 @@ console.warn = (arg1, arg2, arg3, ...args) => {
|
|
|
40
40
|
|
|
41
41
|
// process.traceDeprecation = true
|
|
42
42
|
export const getConfig = (config) => {
|
|
43
|
-
const { client, name='', pwd, env='development', homepage, publicPath, version } = config
|
|
43
|
+
const { client, name='', pwd, env='development', homepage, publicPath, version, port=3000, portServer=undefined } = config
|
|
44
44
|
const { clientDir, componentsDir, distDir, imgsDir } = getDirectories(path, pwd)
|
|
45
45
|
const publicPathResolved = getPublicPath(env, homepage, publicPath)
|
|
46
46
|
|
|
@@ -69,11 +69,11 @@ export const getConfig = (config) => {
|
|
|
69
69
|
historyApiFallback: true,
|
|
70
70
|
host: '0.0.0.0',
|
|
71
71
|
hot: true,
|
|
72
|
-
port:
|
|
72
|
+
port: port,
|
|
73
73
|
proxy: {
|
|
74
74
|
'/api': {
|
|
75
75
|
logLevel: 'silent',
|
|
76
|
-
target:
|
|
76
|
+
target: `http://0.0.0.0:${getPortServer({ port, portServer })}`,
|
|
77
77
|
// bypass: async function (req, res, proxyOptions) {
|
|
78
78
|
// // // wait for pong, indicating express has restarted
|
|
79
79
|
// // // all non-asset routes are triggered (even the main page)
|
|
@@ -84,7 +84,7 @@ export const getConfig = (config) => {
|
|
|
84
84
|
},
|
|
85
85
|
'/email': {
|
|
86
86
|
logLevel: 'silent',
|
|
87
|
-
target:
|
|
87
|
+
target: `http://0.0.0.0:${getPortServer({ port, portServer })}`,
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
90
|
},
|