-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
feat(lib): enable minification but keep pure annotations for es output with terser #20522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
23
commits into
main
Choose a base branch
from
copilot/fix-6b58c28a-21c9-4376-aa7a-1978340e82f0
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+58
−8
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
4fdc0f5
Initial plan
Copilot eef351e
Initial exploration and test setup for lib mode terser minification
Copilot 05b379d
feat: enable minify for lib mode es output + build.minify: 'terser'
Copilot d828c58
feat: address PR feedback - remove ES lib condition and update terser…
Copilot 2b0d3b3
feat: add pure annotation test and function call in lib mode
Copilot 82eb360
Address PR review feedback: update regex pattern and simplify tests
Copilot 9b92f43
test: update test description for pure annotations with terser
Copilot 4685306
feat: update pure annotations test to check functional behavior inste…
Copilot 98f797c
feat: implement Object.assign pure annotation as requested but preser…
Copilot 4b346e4
remove drop_console
sapphi-red 9365cb5
Address PR feedback: remove drop_console, add debugger test, and clea…
Copilot c2987ff
update
sapphi-red c76da0f
update
sapphi-red 6b43682
update
sapphi-red 811918c
update
sapphi-red 55a32a8
update
sapphi-red 59bdf7d
Address PR feedback: remove debugger test, update pure annotation tes…
Copilot 43074bb
Revert "Address PR feedback: remove debugger test, update pure annota…
sapphi-red b01bef7
chore: update
sapphi-red dc3b0bf
chore: update
sapphi-red dbcbc41
test: add test for iife terser
sapphi-red 51ad184
fix: respect `preserve_annotations` for non-es output
sapphi-red 223dff8
chore: merge main
sapphi-red File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import path from 'node:path' | ||
import { defineConfig } from 'vite' | ||
import baseConfig from './vite.config' | ||
|
||
export default defineConfig({ | ||
...baseConfig, | ||
build: { | ||
...baseConfig.build, | ||
minify: 'terser', | ||
terserOptions: { | ||
compress: { | ||
drop_debugger: true, | ||
sapphi-red marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
}, | ||
outDir: 'dist/terser', | ||
lib: { | ||
...baseConfig.build.lib, | ||
sapphi-red marked this conversation as resolved.
Show resolved
Hide resolved
|
||
entry: path.resolve(__dirname, 'src/main.js'), | ||
formats: ['es', 'iife'], | ||
}, | ||
}, | ||
plugins: [], | ||
cacheDir: 'node_modules/.vite-terser', | ||
}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.