Socket
Socket
Sign inDemoInstall

vite

Package Overview
Dependencies
33
Maintainers
1
Versions
552
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.11.0 to 0.11.1

9

CHANGELOG.md

@@ -0,1 +1,10 @@

## [0.11.1](https://github.com/vuejs/vite/compare/v0.11.0...v0.11.1) (2020-05-06)
### Bug Fixes
* fix rewrite when encountering external url ([e78c9f7](https://github.com/vuejs/vite/commit/e78c9f7680c2652b13f4270182c860417e388b2e))
# [0.11.0](https://github.com/vuejs/vite/compare/v0.10.3...v0.11.0) (2020-05-06)

@@ -2,0 +11,0 @@

2

dist/serverPluginModuleRewrite.js

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

if (utils_1.isExternalUrl(id)) {
return;
break;
}

@@ -130,0 +130,0 @@ let resolved;

{
"name": "vite",
"version": "0.11.0",
"version": "0.11.1",
"license": "MIT",

@@ -5,0 +5,0 @@ "author": "Evan You",

@@ -42,2 +42,3 @@ # vite ⚡

- [Hot Module Replacement](#hot-module-replacement)
- [TypeScript](#typescript)
- [CSS / JSON Importing](#css--json-importing)

@@ -48,2 +49,3 @@ - [Asset URL Handling](#asset-url-handling)

- [CSS Pre-processors](#css-pre-processors)
- [JSX](#jsx)
- [Production Build](#production-build)

@@ -108,3 +110,6 @@

### TypeScript
Starting with v0.11, `vite` supports `<script lang="ts">` in `*.vue` files, and importing `.ts` files out of the box. Note that `vite` does **NOT** perform type checking - it assumes type checking is taken care of by your IDE and build process (you can run `tsc --noEmit` in the build script). With that in mind, `vite` uses [esbuild](https://github.com/evanw/esbuild) to transpile TypeScript into JavaScript which is about 20~30x faster than vanilla `tsc`.
### CSS / JSON Importing

@@ -151,2 +156,34 @@

### JSX
`.jsx` and `.tsx` files are also supported out of the box. JSX transpilation is also handled via `esbuild`.
Because React doesn't ship ES module builds, you either need to use [es-react](https://github.com/lukejacksonn/es-react), or pre-bundle React into a ES module with Snowpack. Easiest way to get it running is:
``` js
import { React, ReactDOM } from 'https://unpkg.com/es-react'
ReactDOM.render(<h1>Hello, what!</h1>, document.getElementById("app"));
```
JSX can also be customized via `--jsx-factory` and `--jsx-fragment` flags from the CLI or `jsx: { factory, fragment }` fro the API. For example, to use [Preact](https://preactjs.com/) with `vite`:
``` json
{
"scripts": {
"dev": "vite --jsx-factory=h"
}
}
```
``` jsx
import { h, render } from "preact"
render(<h1>Hello, what!</h1>, document.getElementById("app"))
```
#### Notes on JSX Support
- Vue 3's JSX transform is still WIP, so `vite`'s JSX support currently only targets React/Preact.
- There is no out-of-the-box HMR when using non-Vue frameworks, but userland HMR support is technically via the server API.
### Production Build

@@ -158,8 +195,4 @@

- `vite build --root dir`: build files in the target directory instead of current working directory.
Internally, we use a highly opinionated Rollup config to generate the build. The build is configurable by passing on most options to Rollup - and most non-rollup string/boolean options have mapping flag in the CLI (see [src/node/build.ts](https://github.com/vuejs/vite/blob/master/src/node/build.ts) for full details).
- `vite build --cdn`: import `vue` from a CDN link in the built js. This will make the build faster, but overall the page payload will be larger because therer will be no tree-shaking for Vue APIs.
Internally, we use a highly opinionated Rollup config to generate the build. There's not much you can configure from the command line, but if you use the API, then the build is configurable by passing on most options to Rollup (see below).
### API

@@ -215,2 +248,4 @@

Check out the full options interface in [src/node/build.ts](https://github.com/vuejs/vite/blob/master/src/node/build.ts).
``` js

@@ -231,8 +266,4 @@ const { build } = require('vite')

// https://github.com/vuejs/rollup-plugin-vue/tree/next#options
},
root: process.cwd(),
cdn: false,
write: true,
minify: true,
silent: false
}
// ...
})

@@ -239,0 +270,0 @@ })()

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc