@nitro-web/webpack 0.0.181 → 0.0.183

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitro-web/webpack",
3
- "version": "0.0.181",
3
+ "version": "0.0.183",
4
4
  "repository": "github:boycce/nitro-web",
5
5
  "homepage": "https://boycce.github.io/nitro-web/",
6
6
  "main": "./webpack.config.js",
@@ -17,7 +17,7 @@ export function getConfig(config: any): (env: any, argv: any) => {
17
17
  historyApiFallback: boolean;
18
18
  host: string;
19
19
  hot: boolean;
20
- port: number;
20
+ port: any;
21
21
  proxy: {
22
22
  '/api': {
23
23
  logLevel: string;
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: 3000,
72
+ port: port,
73
73
  proxy: {
74
74
  '/api': {
75
75
  logLevel: 'silent',
76
- target: 'http://0.0.0.0:3001',
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: 'http://0.0.0.0:3001',
87
+ target: `http://0.0.0.0:${getPortServer({ port, portServer })}`,
88
88
  },
89
89
  },
90
90
  },