@epinova/webpack
Advanced tools
@@ -0,1 +1,2 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
@@ -9,2 +10,3 @@ | ||
const RemoveEmptyScriptsPlugin = require('webpack-remove-empty-scripts'); | ||
const chalk = require('chalk'); | ||
@@ -24,2 +26,10 @@ const ChunksWebpackPlugin = require('./manifest-plugin'); | ||
browserstackUrl: argv.browserstack || 'http://127.0.0.1', | ||
certificate: { | ||
path: path.join( | ||
path.resolve(process.cwd() || process.env.PWD), | ||
'./webpack-dev-server.pfx' | ||
), | ||
passphrase: 'webpack-dev-server', | ||
suppressCertificateWarning: false, | ||
}, | ||
}; | ||
@@ -50,2 +60,10 @@ | ||
if (!options.certificate.suppressCertificateWarning) { | ||
if (!fs.existsSync(options.certificate.path)) { | ||
const text = `WARNING @epinova/webpack: The certificate ${options.certificate.path} was not found, please export a valid certficate by running "dotnet dev-certs https -ep ./webpack-dev-server.pfx -p ${options.certificate.passphrase} --trust"`; | ||
const message = chalk.black.bgYellow(text); | ||
console.warn(message); | ||
} | ||
} | ||
return function (env, argv) { | ||
@@ -64,2 +82,10 @@ const isDevServer = process.env.WEBPACK_SERVE; | ||
const https = { | ||
type: 'https', | ||
options: { | ||
pfx: options.certificate.path, | ||
passphrase: options.certificate.passphrase, | ||
}, | ||
}; | ||
const config = { | ||
@@ -76,3 +102,3 @@ stats: 'errors-warnings', | ||
headers: { 'Access-Control-Allow-Origin': '*' }, | ||
server: options.https ? 'https' : 'http', | ||
server: options.https ? https : 'http', | ||
host: options.devServerHost, | ||
@@ -79,0 +105,0 @@ port: options.devServerPort, |
@@ -0,0 +0,0 @@ const path = require('path'); |
@@ -15,2 +15,3 @@ { | ||
"babel-loader": "^9.1.2", | ||
"chalk": "^5.3.0", | ||
"clean-webpack-plugin": "^4.0.0", | ||
@@ -60,3 +61,3 @@ "css-loader": "^6.8.1", | ||
}, | ||
"version": "1.6.0" | ||
"version": "1.7.0-alpha1" | ||
} |
@@ -17,4 +17,4 @@ # @epinova/webpack | ||
- Webpack 5 | ||
- Support for Node 17+ | ||
- Webpack 5 | ||
- Support for Node 17+ | ||
@@ -202,2 +202,4 @@ # 1.4.4 | ||
## [Upgrade to v1.6](MIGRATION_1.6.md) | ||
## Upgrade from v1.3 | ||
@@ -204,0 +206,0 @@ |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
45840
20.32%12
50%771
3.21%260
0.78%25
4.17%1
Infinity%8
33.33%1
Infinity%