vite 2.6.0-beta.3 → 2.6.0-beta.4

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.

@@ -33998,7 +33998,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
33998
33998
  const postcssOptions = (postcssConfig && postcssConfig.options) || {};
33999
33999
  const postcssPlugins = postcssConfig && postcssConfig.plugins ? postcssConfig.plugins.slice() : [];
34000
34000
  if (needInlineImport) {
34001
- postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-3d7b2eed.js'); }).then(function (n) { return n.index; })).default({
34001
+ postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-e39b05d6.js'); }).then(function (n) { return n.index; })).default({
34002
34002
  async resolve(id, basedir) {
34003
34003
  const resolved = await atImportResolvers.css(id, path__default.join(basedir, '*'));
34004
34004
  if (resolved) {
@@ -34012,7 +34012,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
34012
34012
  replacer: urlReplacer
34013
34013
  }));
34014
34014
  if (isModule) {
34015
- postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-5375df11.js'); }).then(function (n) { return n.index; })).default({
34015
+ postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-c4cf6e92.js'); }).then(function (n) { return n.index; })).default({
34016
34016
  ...modulesOptions,
34017
34017
  getJSON(cssFileName, _modules, outputFileName) {
34018
34018
  modules = _modules;
@@ -34968,7 +34968,7 @@ const assetAttrsConfig = {
34968
34968
  const isAsyncScriptMap = new WeakMap();
34969
34969
  async function traverseHtml(html, filePath, visitor) {
34970
34970
  // lazy load compiler
34971
- const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-84e8737f.js'); }).then(function (n) { return n.compilerDom_cjs; });
34971
+ const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-1e0a75a8.js'); }).then(function (n) { return n.compilerDom_cjs; });
34972
34972
  // @vue/compiler-core doesn't like lowercase doctypes
34973
34973
  html = html.replace(/<!doctype\s/i, '<!DOCTYPE ');
34974
34974
  try {
@@ -50996,15 +50996,17 @@ function assetImportMetaUrlPlugin(config) {
50996
50996
  if (templateLiteral.expressions.length) {
50997
50997
  const pattern = buildGlobPattern(templateLiteral);
50998
50998
  // Note: native import.meta.url is not supported in the baseline
50999
- // target so we use window.location here -
51000
- s.overwrite(index, index + exp.length, `new URL(import.meta.globEagerDefault(${JSON.stringify(pattern)})[${rawUrl}], window.location)`);
50999
+ // target so we use the global location here. It can be
51000
+ // window.location or self.location in case it is used in a Web Worker.
51001
+ // @see https://developer.mozilla.org/en-US/docs/Web/API/Window/self
51002
+ s.overwrite(index, index + exp.length, `new URL(import.meta.globEagerDefault(${JSON.stringify(pattern)})[${rawUrl}], self.location)`);
51001
51003
  continue;
51002
51004
  }
51003
51005
  }
51004
51006
  const url = rawUrl.slice(1, -1);
51005
51007
  const file = path__default.resolve(path__default.dirname(id), url);
51006
51008
  const builtUrl = await fileToUrl(file, config, this);
51007
- s.overwrite(index, index + exp.length, `new URL(${JSON.stringify(builtUrl)}, window.location)`);
51009
+ s.overwrite(index, index + exp.length, `new URL(${JSON.stringify(builtUrl)}, self.location)`);
51008
51010
  }
51009
51011
  if (s) {
51010
51012
  return {
@@ -51063,16 +51065,6 @@ function resolveBuildOptions(raw) {
51063
51065
  cssCodeSplit: !(raw === null || raw === void 0 ? void 0 : raw.lib),
51064
51066
  sourcemap: false,
51065
51067
  rollupOptions: {},
51066
- commonjsOptions: {
51067
- include: [/node_modules/],
51068
- extensions: ['.js', '.cjs'],
51069
- ...raw === null || raw === void 0 ? void 0 : raw.commonjsOptions
51070
- },
51071
- dynamicImportVarsOptions: {
51072
- warnOnError: true,
51073
- exclude: [/node_modules/],
51074
- ...raw === null || raw === void 0 ? void 0 : raw.dynamicImportVarsOptions
51075
- },
51076
51068
  minify: (raw === null || raw === void 0 ? void 0 : raw.ssr) ? false : 'esbuild',
51077
51069
  terserOptions: {},
51078
51070
  write: true,
@@ -51085,7 +51077,17 @@ function resolveBuildOptions(raw) {
51085
51077
  // brotliSize: true,
51086
51078
  chunkSizeWarningLimit: 500,
51087
51079
  watch: null,
51088
- ...raw
51080
+ ...raw,
51081
+ commonjsOptions: {
51082
+ include: [/node_modules/],
51083
+ extensions: ['.js', '.cjs'],
51084
+ ...raw === null || raw === void 0 ? void 0 : raw.commonjsOptions
51085
+ },
51086
+ dynamicImportVarsOptions: {
51087
+ warnOnError: true,
51088
+ exclude: [/node_modules/],
51089
+ ...raw === null || raw === void 0 ? void 0 : raw.dynamicImportVarsOptions
51090
+ }
51089
51091
  };
51090
51092
  // handle special build targets
51091
51093
  if (resolved.target === 'modules') {
@@ -57217,7 +57219,7 @@ function readFileIfExists(value) {
57217
57219
  * https://github.com/webpack/webpack-dev-server/blob/master/LICENSE
57218
57220
  */
57219
57221
  async function createCertificate() {
57220
- const { generate } = await Promise.resolve().then(function () { return require('./dep-ff36f4f1.js'); }).then(function (n) { return n.index; });
57222
+ const { generate } = await Promise.resolve().then(function () { return require('./dep-d574094c.js'); }).then(function (n) { return n.index; });
57221
57223
  const pems = generate(null, {
57222
57224
  algorithm: 'sha256',
57223
57225
  days: 30,
@@ -75059,7 +75061,9 @@ async function startServer(server, inlinePort, isRestart = false) {
75059
75061
  }
75060
75062
  if (options.open && !isRestart) {
75061
75063
  const path = typeof options.open === 'string' ? options.open : base;
75062
- openBrowser(path.startsWith('http') ? path : `${protocol}://${hostname.name}:${serverPort}${path}`, true, server.config.logger);
75064
+ openBrowser(path.startsWith('http')
75065
+ ? path
75066
+ : `${protocol}://${hostname.name}:${serverPort}${path}`, true, server.config.logger);
75063
75067
  }
75064
75068
  return server;
75065
75069
  }
@@ -100146,7 +100150,9 @@ async function preview(config, serverOptions) {
100146
100150
  });
100147
100151
  if (options.open) {
100148
100152
  const path = typeof options.open === 'string' ? options.open : base;
100149
- openBrowser(path.startsWith('http') ? path : `${protocol}://${hostname.name}:${serverPort}${path}`, true, logger);
100153
+ openBrowser(path.startsWith('http')
100154
+ ? path
100155
+ : `${protocol}://${hostname.name}:${serverPort}${path}`, true, logger);
100150
100156
  }
100151
100157
  return httpServer;
100152
100158
  }
@@ -100177,4 +100183,4 @@ exports.send = send$1;
100177
100183
  exports.sortUserPlugins = sortUserPlugins;
100178
100184
  exports.source = source;
100179
100185
  exports.transformWithEsbuild = transformWithEsbuild;
100180
- //# sourceMappingURL=dep-2f27bfba.js.map
100186
+ //# sourceMappingURL=dep-ba6b30a0.js.map