@nitro-web/webpack 0.0.197 → 0.0.198

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.197",
3
+ "version": "0.0.198",
4
4
  "repository": "github:boycce/nitro-web",
5
5
  "homepage": "https://boycce.github.io/nitro-web/",
6
6
  "main": "./webpack.config.js",
@@ -1 +1 @@
1
- {"version":3,"file":"webpack.config.d.ts","sourceRoot":"","sources":["../webpack.config.js"],"names":[],"mappings":"AAyCO,yCAOG,QAAG,EAAE,SAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwRlB"}
1
+ {"version":3,"file":"webpack.config.d.ts","sourceRoot":"","sources":["../webpack.config.js"],"names":[],"mappings":"AAyCO,yCAWG,QAAG,EAAE,SAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwRlB"}
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, getPortServer } from 'nitro-web/util'
19
+ import { getDirectories } from 'nitro-web/util'
20
20
 
21
21
  const _require = createRequire(import.meta.url)
22
22
  const isBuild = process.env.NODE_ENV == 'production'
@@ -36,13 +36,17 @@ console.warn = (arg1, arg2, arg3, ...args) => {
36
36
  if (!arg1) return // remove empty console.warn
37
37
  else if (typeof arg3 === 'string' && arg3.match(/experimental/i)) return // remove main messages
38
38
  else warnOriginal(arg1, arg2, arg3, ...args)
39
- }
39
+ }
40
40
 
41
41
  // process.traceDeprecation = true
42
42
  export const getConfig = (config) => {
43
- const { client, name='', pwd, env='development', homepage, publicPath, version, port=3000, portServer=undefined } = config
43
+ const { client, name='', pwd, env='development', homepage, publicPath, version, port=3000, portServer=3001 } = config
44
44
  const { clientDir, componentsDir, distDir, imgsDir } = getDirectories(path, pwd)
45
45
  const publicPathResolved = getPublicPath(env, homepage, publicPath)
46
+
47
+ if (env === 'development' && port === portServer) {
48
+ console.warn('config.port and config.portServer are the same, which may cause issues')
49
+ }
46
50
 
47
51
  if (!name) throw new Error('No name found in config environement variables?')
48
52
 
@@ -73,7 +77,7 @@ export const getConfig = (config) => {
73
77
  proxy: {
74
78
  '/api': {
75
79
  logLevel: 'silent',
76
- target: `http://0.0.0.0:${getPortServer({ port, portServer })}`,
80
+ target: `http://0.0.0.0:${portServer}`,
77
81
  // bypass: async function (req, res, proxyOptions) {
78
82
  // // // wait for pong, indicating express has restarted
79
83
  // // // all non-asset routes are triggered (even the main page)
@@ -84,7 +88,7 @@ export const getConfig = (config) => {
84
88
  },
85
89
  '/email': {
86
90
  logLevel: 'silent',
87
- target: `http://0.0.0.0:${getPortServer({ port, portServer })}`,
91
+ target: `http://0.0.0.0:${portServer}`,
88
92
  },
89
93
  },
90
94
  },