@nitro-web/webpack 0.0.23 → 0.0.24
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 +2 -2
- package/webpack.config.js +6 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nitro-web/webpack",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"repository": "github:boycce/nitro-web",
|
|
5
5
|
"homepage": "https://boycce.github.io/nitro-web/",
|
|
6
6
|
"main": "./webpack.config.js",
|
|
@@ -78,6 +78,6 @@
|
|
|
78
78
|
"extends": "../core/.eslintrc.json"
|
|
79
79
|
},
|
|
80
80
|
"engines": {
|
|
81
|
-
"node": ">=18"
|
|
81
|
+
"node": ">=18 <21"
|
|
82
82
|
}
|
|
83
83
|
}
|
package/webpack.config.js
CHANGED
|
@@ -336,19 +336,21 @@ class InterpolateHtmlPlugin {
|
|
|
336
336
|
|
|
337
337
|
function getPublicPath(env, homepage, publicPath) {
|
|
338
338
|
/**
|
|
339
|
-
* Returns public path used for
|
|
339
|
+
* Returns public path used for webpack, used in the relative asset paths
|
|
340
340
|
* @param {string} env - 'development', 'staging', 'production'
|
|
341
|
-
* @param {string} publicPath - proces.env.publicPath
|
|
342
341
|
* @param {string} homepage - package.json homepage
|
|
342
|
+
* @param {string} <publicPath> - process.env.publicPath
|
|
343
343
|
*/
|
|
344
344
|
if (publicPath) {
|
|
345
345
|
const publicPathObj = new URL(publicPath, 'https://domain.com')
|
|
346
|
+
if (env !== 'development') console.info(`Public path: ${publicPathObj.pathname}`)
|
|
346
347
|
return publicPathObj.pathname
|
|
347
348
|
|
|
348
349
|
} else if (homepage) {
|
|
349
350
|
const homepageObj = new URL(homepage, 'https://domain.com')
|
|
350
|
-
if (env
|
|
351
|
-
|
|
351
|
+
if (env !== 'development') console.info(`Public path, from package homepage: ${homepageObj.pathname}`)
|
|
352
|
+
if (env !== 'development') return homepageObj.pathname
|
|
353
|
+
else return '/'
|
|
352
354
|
|
|
353
355
|
} else {
|
|
354
356
|
return '/'
|