v1.0 with SW PWA enabled

This commit is contained in:
Blomios
2026-01-01 17:40:53 +01:00
parent 1c0e22aac1
commit 3c8bebb2ad
29775 changed files with 2197201 additions and 119080 deletions

View File

@ -8,6 +8,10 @@ var normalizeOptions = require('./normalize-options');
var realpathFS = process.platform !== 'win32' && fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync;
var relativePathRegex = /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/;
var windowsDriveRegex = /^\w:[/\\]*$/;
var nodeModulesRegex = /[/\\]node_modules[/\\]*$/;
var homedir = getHomedir();
var defaultPaths = function () {
return [
@ -96,7 +100,7 @@ module.exports = function resolveSync(x, options) {
// ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory
var absoluteStart = maybeRealpathSync(realpathSync, path.resolve(basedir), opts);
if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) {
if (relativePathRegex.test(x)) {
var res = path.resolve(absoluteStart, x);
if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/';
var m = loadAsFileSync(res) || loadAsDirectorySync(res);
@ -137,10 +141,10 @@ module.exports = function resolveSync(x, options) {
function loadpkg(dir) {
if (dir === '' || dir === '/') return;
if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) {
if (process.platform === 'win32' && windowsDriveRegex.test(dir)) {
return;
}
if ((/[/\\]node_modules[/\\]*$/).test(dir)) return;
if (nodeModulesRegex.test(dir)) return;
var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json');