vite 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of vite might be problematic. Click here for more details.

package/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## [2.1.2](https://github.com/vitejs/vite/compare/v2.1.1...v2.1.2) (2021-03-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update esbuild target to allow destructuring ([#2566](https://github.com/vitejs/vite/issues/2566)) ([da49782](https://github.com/vitejs/vite/commit/da497823e249aaf4d3a7da80e2211501f6159e1e))
7
+ * **manifest:** do not fail when using rollupOtions.external ([#2532](https://github.com/vitejs/vite/issues/2532)) ([e44cc11](https://github.com/vitejs/vite/commit/e44cc11bcf265d0bc4eaf5679c3b84d4b31d10ad))
8
+
9
+
10
+
1
11
  ## [2.1.1](https://github.com/vitejs/vite/compare/v2.1.0...v2.1.1) (2021-03-16)
2
12
 
3
13
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var build = require('./dep-4560a795.js');
3
+ var build = require('./dep-efe32886.js');
4
4
 
5
5
  /**
6
6
  * Make a map and return a function for checking if a key
@@ -3,7 +3,7 @@
3
3
  var path$1 = require('path');
4
4
  var resolve$1 = require('resolve');
5
5
  var fs = require('fs');
6
- var build = require('./dep-4560a795.js');
6
+ var build = require('./dep-efe32886.js');
7
7
  var _postcss = require('postcss');
8
8
  var index$1 = require('./dep-685e7ba2.js');
9
9
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var _postcss = require('postcss');
4
- var build$1 = require('./dep-4560a795.js');
4
+ var build$1 = require('./dep-efe32886.js');
5
5
  var path = require('path');
6
6
  var require$$0 = require('crypto');
7
7
  var fs = require('fs');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var build = require('./dep-4560a795.js');
3
+ var build = require('./dep-efe32886.js');
4
4
  var require$$0 = require('crypto');
5
5
 
6
6
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
@@ -18853,7 +18853,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers) {
18853
18853
  const postcssOptions = (postcssConfig && postcssConfig.options) || {};
18854
18854
  const postcssPlugins = postcssConfig && postcssConfig.plugins ? postcssConfig.plugins.slice() : [];
18855
18855
  if (needInlineImport) {
18856
- postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-bb78b311.js'); }).then(function (n) { return n.index; })).default({
18856
+ postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-0f464c78.js'); }).then(function (n) { return n.index; })).default({
18857
18857
  async resolve(id, basedir) {
18858
18858
  const resolved = await atImportResolvers.css(id, path__default.join(basedir, '*'));
18859
18859
  if (resolved) {
@@ -18867,7 +18867,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers) {
18867
18867
  replacer: urlReplacer
18868
18868
  }));
18869
18869
  if (isModule) {
18870
- postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-ecfe66e3.js'); }).then(function (n) { return n.index; })).default({
18870
+ postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-8a660aa5.js'); }).then(function (n) { return n.index; })).default({
18871
18871
  ...modulesOptions,
18872
18872
  getJSON(cssFileName, _modules, outputFileName) {
18873
18873
  modules = _modules;
@@ -19007,7 +19007,7 @@ async function doUrlReplace(rawUrl, matched, replacer) {
19007
19007
  }
19008
19008
  let CleanCSS;
19009
19009
  async function minifyCSS(css, config) {
19010
- CleanCSS = CleanCSS || (await Promise.resolve().then(function () { return require('./dep-8e52438c.js'); }).then(function (n) { return n.index; })).default;
19010
+ CleanCSS = CleanCSS || (await Promise.resolve().then(function () { return require('./dep-fbc42d74.js'); }).then(function (n) { return n.index; })).default;
19011
19011
  const res = new CleanCSS({
19012
19012
  rebase: false,
19013
19013
  ...config.build.cleanCssOptions
@@ -23918,7 +23918,7 @@ const assetAttrsConfig = {
23918
23918
  };
23919
23919
  async function traverseHtml(html, filePath, visitor) {
23920
23920
  // lazy load compiler
23921
- const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-8710b34d.js'); }).then(function (n) { return n.compilerDom_cjs; });
23921
+ const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-0c7ee4d5.js'); }).then(function (n) { return n.compilerDom_cjs; });
23922
23922
  // @vue/compiler-core doesn't like lowercase doctypes
23923
23923
  html = html.replace(/<!doctype\s/i, '<!DOCTYPE ');
23924
23924
  try {
@@ -24581,6 +24581,16 @@ function manifestPlugin(config) {
24581
24581
  return `_` + path__default.basename(chunk.fileName);
24582
24582
  }
24583
24583
  }
24584
+ function getInternalImports(imports) {
24585
+ const filteredImports = [];
24586
+ for (const file of imports) {
24587
+ if (bundle[file] === undefined) {
24588
+ continue;
24589
+ }
24590
+ filteredImports.push(getChunkName(bundle[file]));
24591
+ }
24592
+ return filteredImports;
24593
+ }
24584
24594
  function createChunk(chunk) {
24585
24595
  const manifestChunk = {
24586
24596
  file: chunk.fileName
@@ -24595,17 +24605,16 @@ function manifestPlugin(config) {
24595
24605
  manifestChunk.isDynamicEntry = true;
24596
24606
  }
24597
24607
  if (chunk.imports.length) {
24598
- const imports = [];
24599
- for (const file of chunk.imports) {
24600
- const importItem = bundle[file];
24601
- importItem && imports.push(getChunkName(importItem));
24602
- }
24603
- if (imports.length > 0) {
24604
- manifestChunk.imports = imports;
24608
+ const internalImports = getInternalImports(chunk.imports);
24609
+ if (internalImports.length > 0) {
24610
+ manifestChunk.imports = internalImports;
24605
24611
  }
24606
24612
  }
24607
24613
  if (chunk.dynamicImports.length) {
24608
- manifestChunk.dynamicImports = chunk.dynamicImports.map((file) => getChunkName(bundle[file]));
24614
+ const internalImports = getInternalImports(chunk.dynamicImports);
24615
+ if (internalImports.length > 0) {
24616
+ manifestChunk.dynamicImports = internalImports;
24617
+ }
24609
24618
  }
24610
24619
  const cssFiles = chunkToEmittedCssFileMap.get(chunk);
24611
24620
  if (cssFiles) {
@@ -44013,7 +44022,9 @@ function resolveBuildOptions(raw) {
44013
44022
  // handle special build targets
44014
44023
  if (resolved.target === 'modules') {
44015
44024
  // https://caniuse.com/es6-module
44016
- resolved.target = ['es2019', 'edge16', 'firefox60', 'chrome61', 'safari11'];
44025
+ // edge18 according to js-table (destructuring is not supported in edge16)
44026
+ // https://github.com/evanw/esbuild/blob/d943e89e50696647d6c89ae623ddfdf564ad3cfc/internal/compat/js_table.go#L84
44027
+ resolved.target = ['es2019', 'edge18', 'firefox60', 'chrome61', 'safari11'];
44017
44028
  }
44018
44029
  else if (resolved.target === 'esnext' && resolved.minify !== 'esbuild') {
44019
44030
  // esnext + terser: limit to es2019 so it can be minified by terser
@@ -44193,7 +44204,7 @@ async function doBuild(inlineConfig = {}) {
44193
44204
  return res;
44194
44205
  }
44195
44206
  else {
44196
- return generate(outputs);
44207
+ return await generate(outputs);
44197
44208
  }
44198
44209
  }
44199
44210
  catch (e) {
@@ -52747,7 +52758,7 @@ function readFileIfExists(value) {
52747
52758
  * https://github.com/webpack/webpack-dev-server/blob/master/LICENSE
52748
52759
  */
52749
52760
  async function createCertificate() {
52750
- const { generate } = await Promise.resolve().then(function () { return require('./dep-109e49a5.js'); }).then(function (n) { return n.index; });
52761
+ const { generate } = await Promise.resolve().then(function () { return require('./dep-ce592790.js'); }).then(function (n) { return n.index; });
52751
52762
  const pems = generate(null, {
52752
52763
  algorithm: 'sha256',
52753
52764
  days: 30,
@@ -69001,7 +69012,7 @@ async function createServer(inlineConfig = {}) {
69001
69012
  const plugins = config.plugins;
69002
69013
  const container = await createPluginContainer(config, watcher);
69003
69014
  const moduleGraph = new ModuleGraph(container);
69004
- const closeHttpServer = createSeverCloseFn(httpServer);
69015
+ const closeHttpServer = createServerCloseFn(httpServer);
69005
69016
  const server = {
69006
69017
  config: config,
69007
69018
  middlewares,
@@ -69279,7 +69290,7 @@ async function startServer(server, inlinePort, isRestart = false) {
69279
69290
  });
69280
69291
  });
69281
69292
  }
69282
- function createSeverCloseFn(server) {
69293
+ function createServerCloseFn(server) {
69283
69294
  if (!server) {
69284
69295
  return () => { };
69285
69296
  }
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var build = require('./dep-4560a795.js');
3
+ var build = require('./dep-efe32886.js');
4
4
  var os = require('os');
5
5
  var http = require('http');
6
6
  var https = require('https');
package/dist/node/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var require$$0$1 = require('events');
4
- var build = require('./chunks/dep-4560a795.js');
4
+ var build = require('./chunks/dep-efe32886.js');
5
5
  var os = require('os');
6
6
  var path = require('path');
7
7
  var tty = require('tty');
@@ -14032,7 +14032,7 @@ cli
14032
14032
  .action(async (root, options) => {
14033
14033
  // output structure is preserved even after bundling so require()
14034
14034
  // is ok here
14035
- const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-4560a795.js'); }).then(function (n) { return n.index$1; });
14035
+ const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-efe32886.js'); }).then(function (n) { return n.index$1; });
14036
14036
  try {
14037
14037
  const server = await createServer({
14038
14038
  root,
@@ -14066,7 +14066,7 @@ cli
14066
14066
  .option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`)
14067
14067
  .option('-m, --mode <mode>', `[string] set env mode`)
14068
14068
  .action(async (root, options) => {
14069
- const { build: build$1 } = await Promise.resolve().then(function () { return require('./chunks/dep-4560a795.js'); }).then(function (n) { return n.build$1; });
14069
+ const { build: build$1 } = await Promise.resolve().then(function () { return require('./chunks/dep-efe32886.js'); }).then(function (n) { return n.build$1; });
14070
14070
  const buildOptions = cleanOptions(options);
14071
14071
  try {
14072
14072
  await build$1({
@@ -14089,7 +14089,7 @@ cli
14089
14089
  .command('optimize [root]')
14090
14090
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
14091
14091
  .action(async (root, options) => {
14092
- const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-4560a795.js'); }).then(function (n) { return n.index; });
14092
+ const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-efe32886.js'); }).then(function (n) { return n.index; });
14093
14093
  try {
14094
14094
  const config = await build.resolveConfig({
14095
14095
  root,
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var build = require('./chunks/dep-4560a795.js');
5
+ var build = require('./chunks/dep-efe32886.js');
6
6
  require('os');
7
7
  require('fs');
8
8
  require('path');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "license": "MIT",
5
5
  "author": "Evan You",
6
6
  "description": "Native-ESM powered web dev build tool",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "//": "READ .github/contributing.md to understand what to put under deps vs. devDeps!",
46
46
  "dependencies": {
47
- "esbuild": "^0.9.2",
47
+ "esbuild": "^0.9.3",
48
48
  "postcss": "^8.2.1",
49
49
  "resolve": "^1.19.0",
50
50
  "rollup": "^2.38.5"