-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Labels
feat: library modehas workaroundp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
this pr changed the default minify to esbuild
Reproduction
- create project
npm init vite@latest test -- --template vanilla && cd test && npm i- config
import { defineConfig } from 'vite';
// https://vitejs.dev/config/
export default defineConfig({
build: {
lib: {
name: 'test',
entry: 'main.js',
},
},
});- edit main.js
const a = {};
console.log({...a})- build
npx vite build && cat dist/test.umd.js- result(formated)
var c = Object.defineProperty;
var o = Object.getOwnPropertySymbols;
var d = Object.prototype.hasOwnProperty,
s = Object.prototype.propertyIsEnumerable;
var f = (n, e, i) =>
e in n
? c(n, e, { enumerable: !0, configurable: !0, writable: !0, value: i })
: (n[e] = i),
t = (n, e) => {
for (var i in e || (e = {})) d.call(e, i) && f(n, i, e[i]);
if (o) for (var i of o(e)) s.call(e, i) && f(n, i, e[i]);
return n;
};
(function (n) {
typeof define == 'function' && define.amd ? define(n) : n();
})(function () {
'use strict';
console.log(t({}, {}));
});System Info
System:
OS: macOS 11.6
CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
Memory: 2.99 GB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.10.0 - ~/.n/bin/node
Yarn: 1.22.10 - ~/.n/bin/yarn
npm: 7.5.3 - ~/.n/bin/npm
Browsers:
Chrome: 95.0.4638.54
Firefox: 90.0.2
Safari: 14.1.2
npmPackages:
@vitejs/plugin-react-refresh: ^1.3.3 => 1.3.3
vite: ^2.4.4 => 2.4.4Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feat: library modehas workaroundp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)

