From a8e54e79d41a5e710c56d0c8b0f51dcd57ea0311 Mon Sep 17 00:00:00 2001 From: Shu Ding Date: Thu, 15 Sep 2022 14:58:01 +0200 Subject: [PATCH] Add missing feature in next-swc (#40550) `shake_exports` relies on `ecma_transforms_optimization`, otherwise this will be thrown if running tests: ``` error[E0433]: failed to resolve: could not find `optimization` in `transforms` --> crates/core/src/shake_exports.rs:7:23 | 7 | ecma::transforms::optimization::simplify::dce::{dce, Config as DCEConfig}, | ^^^^^^^^^^^^ could not find `optimization` in `transforms` ``` ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) --- packages/next-swc/crates/core/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/next-swc/crates/core/Cargo.toml b/packages/next-swc/crates/core/Cargo.toml index 0976341e96b5c6a..ad85a547dcba10b 100644 --- a/packages/next-swc/crates/core/Cargo.toml +++ b/packages/next-swc/crates/core/Cargo.toml @@ -40,6 +40,7 @@ swc_core = { version = "0.23.24", features = [ "__ecma_transforms", "ecma_transforms_react", "ecma_transforms_typescript", + "ecma_transforms_optimization", "ecma_parser", "ecma_parser_typescript", "cached",