-
-
Notifications
You must be signed in to change notification settings - Fork 496
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(minifier): do not join
require
calls for cjs-module-lexer
- Loading branch information
Showing
4 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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
24 changes: 24 additions & 0 deletions
24
crates/oxc_minifier/tests/ast_passes/collapse_variable_declarations.rs
This file contains 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 @@ | ||
//! <https://github.com/google/closure-compiler/blob/master/test/com/google/javascript/jscomp/CollapseVariableDeclarations.java> | ||
use crate::CompressOptions; | ||
|
||
fn test(source_text: &str, expected: &str) { | ||
let options = CompressOptions::all_true(); | ||
crate::test(source_text, expected, options); | ||
} | ||
|
||
fn test_same(source_text: &str) { | ||
test(source_text, source_text); | ||
} | ||
|
||
#[test] | ||
fn cjs() { | ||
test_same( | ||
" | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var compilerDom = require('@vue/compiler-dom'); | ||
var runtimeDom = require('@vue/runtime-dom'); | ||
var shared = require('@vue/shared'); | ||
", | ||
); | ||
} |
This file contains 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mod collapse_variable_declarations; | ||
mod fold_conditions; | ||
mod fold_constants; | ||
mod remove_dead_code; | ||
|