Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nuxt/core

Package Overview
Dependencies
Maintainers
3
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nuxt/core - npm Package Compare versions

Comparing version 2.14.12 to 2.15.0

CHANGELOG.md

286

dist/core.js
/*!
* @nuxt/core v2.14.12 (c) 2016-2020
* - All the amazing contributors
* Released under the MIT License.
* @nuxt/core v2.15.0 (c) 2016-2021
* Released under the MIT License
* Repository: https://github.com/nuxt/nuxt.js
* Website: https://nuxtjs.org

@@ -17,2 +16,3 @@ */

const utils = require('@nuxt/utils');
const lodash = require('lodash');
const Hookable = require('hable');

@@ -148,7 +148,9 @@ const config = require('@nuxt/config');

requireModule (moduleOpts) {
return this.addModule(moduleOpts)
requireModule (moduleOpts, { paths } = {}) {
return this.addModule(moduleOpts, undefined, { paths })
}
async addModule (moduleOpts) {
async addModule (moduleOpts, arg2, arg3) {
// Arg2 was previously used for requireOnce which is ignored now
const { paths } = { ...arg2, ...arg3 };
let src;

@@ -182,3 +184,5 @@ let options;

try {
handler = this.nuxt.resolver.requireModule(src, { useESM: true });
handler = this.nuxt.resolver.requireModule(src, { paths });
// pnp support
try { (global.__NUXT_PATHS__ || []).push(this.nuxt.resolver.resolvePath(src, { paths })); } catch (_err) {}
} catch (error) {

@@ -243,228 +247,4 @@ if (error.code !== 'MODULE_NOT_FOUND') {

var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
var version = "2.15.0";
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
var _freeGlobal = freeGlobal;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = _freeGlobal || freeSelf || Function('return this')();
var _root = root;
/** Built-in value references. */
var Symbol = _root.Symbol;
var _Symbol = Symbol;
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Built-in value references. */
var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
/**
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the raw `toStringTag`.
*/
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag),
tag = value[symToStringTag];
try {
value[symToStringTag] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
var _getRawTag = getRawTag;
/** Used for built-in method references. */
var objectProto$1 = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString$1 = objectProto$1.toString;
/**
* Converts `value` to a string using `Object.prototype.toString`.
*
* @private
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
*/
function objectToString(value) {
return nativeObjectToString$1.call(value);
}
var _objectToString = objectToString;
/** `Object#toString` result references. */
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
/** Built-in value references. */
var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
/**
* The base implementation of `getTag` without fallbacks for buggy environments.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
if (value == null) {
return value === undefined ? undefinedTag : nullTag;
}
return (symToStringTag$1 && symToStringTag$1 in Object(value))
? _getRawTag(value)
: _objectToString(value);
}
var _baseGetTag = baseGetTag;
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
var _overArg = overArg;
/** Built-in value references. */
var getPrototype = _overArg(Object.getPrototypeOf, Object);
var _getPrototype = getPrototype;
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return value != null && typeof value == 'object';
}
var isObjectLike_1 = isObjectLike;
/** `Object#toString` result references. */
var objectTag = '[object Object]';
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto$2 = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike_1(value) || _baseGetTag(value) != objectTag) {
return false;
}
var proto = _getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty$1.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString;
}
var isPlainObject_1 = isPlainObject;
var version = "2.14.12";
class Resolver {

@@ -481,19 +261,13 @@ constructor (nuxt) {

const { createRequire } = this.options;
this._require = createRequire ? createRequire(module) : module.require;
this._resolve = require.resolve;
this._createRequire = this.options.createRequire || utils.createRequire;
this._require = this._createRequire(__filename);
}
resolveModule (path) {
resolveModule (path, { paths } = {}) {
try {
return this._resolve(path, {
paths: this.options.modulesDir
return this._require.resolve(path, {
paths: [].concat(paths || [], this.options.modulesDir, global.__NUXT_PATHS__ || [], process.cwd())
})
} catch (error) {
if (error.code !== 'MODULE_NOT_FOUND') {
// TODO: remove after https://github.com/facebook/jest/pull/8487 released
if (process.env.NODE_ENV === 'test' && error.message.startsWith('Cannot resolve module')) {
return
}
throw error

@@ -516,3 +290,3 @@ }

resolvePath (path$1, { alias, isAlias = alias, module, isModule = module, isStyle } = {}) {
resolvePath (path$1, { alias, isAlias = alias, module, isModule = module, isStyle, paths } = {}) {
// TODO: Remove in Nuxt 3

@@ -535,3 +309,3 @@ if (alias) {

if (isModule !== false) {
resolvedPath = this.resolveModule(path$1);
resolvedPath = this.resolveModule(path$1, { paths });
}

@@ -583,3 +357,3 @@

requireModule (path, { esm, useESM = esm, alias, isAlias = alias, intropDefault, interopDefault = intropDefault } = {}) {
requireModule (path, { alias, isAlias = alias, intropDefault, interopDefault = intropDefault, paths } = {}) {
let resolvedPath = path;

@@ -595,5 +369,2 @@ let requiredModule;

}
if (esm) {
consola__default['default'].warn('Using esm is deprecated and will be removed in Nuxt 3. Use `useESM` instead.');
}

@@ -604,3 +375,3 @@ let lastError;

try {
resolvedPath = this.resolvePath(path, { isAlias });
resolvedPath = this.resolvePath(path, { isAlias, paths });
} catch (e) {

@@ -618,14 +389,5 @@ lastError = e;

// By default use esm only for js,mjs files outside of node_modules
if (useESM === undefined) {
useESM = !isExternal && /.(js|mjs)$/.test(resolvedPath);
}
// Try to require
try {
if (useESM) {
requiredModule = this._require(resolvedPath);
} else {
requiredModule = require(resolvedPath);
}
requiredModule = this._require(resolvedPath);
} catch (e) {

@@ -720,3 +482,3 @@ lastError = e;

// Add hooks
if (isPlainObject_1(this.options.hooks)) {
if (lodash.isPlainObject(this.options.hooks)) {
this.addHooks(this.options.hooks);

@@ -723,0 +485,0 @@ } else if (typeof this.options.hooks === 'function') {

{
"name": "@nuxt/core",
"version": "2.14.12",
"version": "2.15.0",
"repository": "nuxt/nuxt.js",

@@ -11,14 +11,10 @@ "license": "MIT",

"dependencies": {
"@nuxt/config": "2.14.12",
"@nuxt/devalue": "^1.2.4",
"@nuxt/server": "2.14.12",
"@nuxt/utils": "2.14.12",
"@nuxt/vue-renderer": "2.14.12",
"consola": "^2.15.0",
"debug": "^4.2.0",
"esm": "^3.2.25",
"fs-extra": "^8.1.0",
"@nuxt/config": "2.15.0",
"@nuxt/server": "2.15.0",
"@nuxt/utils": "2.15.0",
"consola": "^2.15.3",
"fs-extra": "^9.1.0",
"hable": "^3.0.0",
"hash-sum": "^2.0.0",
"std-env": "^2.2.1"
"lodash": "^4.17.20"
},

@@ -25,0 +21,0 @@ "publishConfig": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc