Socket
Socket
Sign inDemoInstall

vite

Package Overview
Dependencies
Maintainers
1
Versions
575
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite - npm Package Compare versions

Comparing version 0.20.5 to 0.20.6

13

CHANGELOG.md

@@ -0,1 +1,14 @@

## [0.20.6](https://github.com/vuejs/vite/compare/v0.20.5...v0.20.6) (2020-06-08)
### Bug Fixes
* exclude hmr from path alias mapping ([4ed19b9](https://github.com/vuejs/vite/commit/4ed19b9b6008f4ba7b498b1b58dd90b4a95d40ae)), closes [#357](https://github.com/vuejs/vite/issues/357)
* fix isAsset test false positive ([#359](https://github.com/vuejs/vite/issues/359)) ([47923c7](https://github.com/vuejs/vite/commit/47923c74b8ac3c5d5e3c23b3138b91d578093590))
* normalize public path for index.html src references ([6ed9f0b](https://github.com/vuejs/vite/commit/6ed9f0bbee3b7042158fab777d1e73df32b47e7f))
* properly handle entry alias for optimized deps ([ed5b668](https://github.com/vuejs/vite/commit/ed5b668f08424e8730c1de15dc4dedfc9fa75474))
* wrong dep in the error message of node-built-in-bail ([#366](https://github.com/vuejs/vite/issues/366)) ([a8c22de](https://github.com/vuejs/vite/commit/a8c22de895646aba3aa80fe3f0323a1a44a7324a))
## [0.20.5](https://github.com/vuejs/vite/compare/v0.20.4...v0.20.5) (2020-06-05)

@@ -2,0 +15,0 @@

6

dist/optimizer/index.js

@@ -84,3 +84,3 @@ "use strict";

options.include.forEach((id) => {
const pkg = resolver_1.resolveNodeModule(root, id);
const pkg = resolver_1.resolveNodeModule(root, id, resolver);
if (pkg && pkg.entryFilePath) {

@@ -216,3 +216,3 @@ qualified[id] = pkg.entryFilePath;

}
const pkgInfo = resolver_1.resolveNodeModule(root, id);
const pkgInfo = resolver_1.resolveNodeModule(root, id, resolver);
if (!pkgInfo || !pkgInfo.entryFilePath) {

@@ -256,3 +256,3 @@ debug(`skipping ${id} (cannot resolve entry)`);

qualifiedDeps.forEach((id) => {
qualified[id] = resolver_1.resolveNodeModule(root, id).entryFilePath;
qualified[id] = resolver_1.resolveNodeModule(root, id, resolver).entryFilePath;
});

@@ -259,0 +259,0 @@ // mark non-optimized deps as external

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const slash_1 = __importDefault(require("slash"));
const utils_1 = require("../utils");
exports.createBuiltInBailPlugin = () => {

@@ -15,5 +12,5 @@ const isbuiltin = require('isbuiltin');

if (importer) {
const match = slash_1.default(importer).match(/\/node_modules\/([^@\/][^\/]*|@[^\/]+\/[^\/]+)\//);
if (match) {
importingDep = match[1];
const pkg = JSON.parse(utils_1.lookupFile(importer, ['package.json']) || `{}`);
if (pkg.name) {
importingDep = pkg.name;
}

@@ -20,0 +17,0 @@ }

@@ -27,8 +27,8 @@ export interface Resolver {

interface NodeModuleInfo {
entry: string | null;
entryFilePath: string | null;
entry: string | undefined;
entryFilePath: string | undefined;
pkg: any;
}
export declare function resolveNodeModule(root: string, id: string): NodeModuleInfo | undefined;
export declare function resolveNodeModule(root: string, id: string, resolver: InternalResolver): NodeModuleInfo | undefined;
export declare function resolveNodeModuleFile(root: string, id: string): string | undefined;
export {};

@@ -12,2 +12,3 @@ "use strict";

const optimizer_1 = require("./optimizer");
const serverPluginHmr_1 = require("./server/serverPluginHmr");
const chalk_1 = __importDefault(require("chalk"));

@@ -176,2 +177,5 @@ const debug = require('debug')('vite:resolve');

normalizePublicPath(publicPath) {
if (publicPath === serverPluginHmr_1.hmrClientPublicPath) {
return publicPath;
}
// preserve query

@@ -261,3 +265,3 @@ const queryMatch = publicPath.match(/\?.*$/);

const basedir = path_1.default.dirname(resolver.requestToFile(importer));
const pkgInfo = resolveNodeModule(basedir, id);
const pkgInfo = resolveNodeModule(basedir, id, resolver);
if (pkgInfo) {

@@ -279,2 +283,6 @@ if (!pkgInfo.entry) {

const depId = deepMatch[1] || deepMatch[2];
if (resolver.alias(depId) === id) {
// this is a deep import but aliased from a bare module id.
return resolveBareModuleRequest(root, depId, importer, resolver);
}
if (resolveOptimizedModule(root, depId)) {

@@ -318,3 +326,3 @@ console.error(chalk_1.default.yellow(`\n[vite] Avoid deep import "${id}" (imported by ${importer})\n` +

const nodeModulesFileMap = new Map();
function resolveNodeModule(root, id) {
function resolveNodeModule(root, id, resolver) {
const cacheKey = `${root}#${id}`;

@@ -342,3 +350,3 @@ const cached = nodeModulesInfoMap.get(cacheKey);

}
let entryPoint = null;
let entryPoint;
// TODO properly support conditinal exports

@@ -367,4 +375,9 @@ // https://nodejs.org/api/esm.html#esm_conditional_exports

// be passed to resolveNodeModuleFile().
let entryFilePath = null;
if (entryPoint) {
let entryFilePath;
// respect user manual alias
const aliased = resolver.alias(id);
if (aliased && aliased !== id) {
entryFilePath = resolveNodeModuleFile(root, aliased);
}
if (!entryFilePath && entryPoint) {
// #284 some packages specify entry without extension...

@@ -371,0 +384,0 @@ entryFilePath = path_1.default.join(path_1.default.dirname(pkgPath), entryPoint);

@@ -41,3 +41,3 @@ "use strict";

// register script as a import dep for hmr
const importee = utils_1.cleanUrl(slash_1.default(path_1.default.resolve('/', srcAttr[1] || srcAttr[2])));
const importee = resolver.normalizePublicPath(utils_1.cleanUrl(slash_1.default(path_1.default.resolve('/', srcAttr[1] || srcAttr[2]))));
serverPluginHmr_1.debugHmr(` ${importer} imports ${importee}`);

@@ -44,0 +44,0 @@ serverPluginHmr_1.ensureMapEntry(serverPluginHmr_1.importerMap, importee).add(importer);

@@ -14,3 +14,3 @@ "use strict";

exports.urlRE = /(url\(\s*['"]?)([^"')]+)(["']?\s*\))/;
exports.cssPreprocessLangRE = /(.+).(less|sass|scss|styl|stylus|postcss)$/;
exports.cssPreprocessLangRE = /(.+)\.(less|sass|scss|styl|stylus|postcss)$/;
function rewriteCssUrls(css, replacerOrBase) {

@@ -17,0 +17,0 @@ let replacer;

{
"name": "vite",
"version": "0.20.5",
"version": "0.20.6",
"license": "MIT",

@@ -54,3 +54,3 @@ "author": "Evan You",

"@babel/parser": "^7.9.4",
"@rollup/plugin-commonjs": "^12.0.0",
"@rollup/plugin-commonjs": "^13.0.0",
"@rollup/plugin-json": "^4.0.3",

@@ -57,0 +57,0 @@ "@rollup/plugin-node-resolve": "^8.0.0",

@@ -449,3 +449,3 @@ # vite ⚡

- Vite is more opinionated and supports more opt-in features by default - for example, features listed above like TypeScript transpilation, CSS import, CSS modules and PostCSS support all work out of the box without the need for configuration.
- Vue support is a first-class feature in Vite. For example, Vite provides a much more fine-grained HMR integration with Vue, and the build config is fined tuned to produce the most efficient bundle.

@@ -452,0 +452,0 @@ - Both solutions can also bundle the app for production, but Vite uses Rollup while Snowpack delegates it to Parcel/webpack. This isn't a significant difference, but worth being aware of if you intend to customize the build.

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