From a0357dd04815b2993fdca134d50cf0a967a72b4d Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Thu, 8 Aug 2024 22:47:16 +0800 Subject: [PATCH] fix: snapshot --- .../webpack/tests/__snapshots__/default.test.ts.snap | 12 ++++++++++++ .../tests/__snapshots__/webpackConfig.test.ts.snap | 3 +++ .../core/tests/__snapshots__/builder.test.ts.snap | 3 +++ .../core/tests/__snapshots__/default.test.ts.snap | 12 ++++++++++++ .../tests/__snapshots__/environments.test.ts.snap | 6 ++++++ .../tests/__snapshots__/index.test.ts.snap | 3 +++ .../tests/__snapshots__/index.test.ts.snap | 3 +++ 7 files changed, 42 insertions(+) diff --git a/packages/compat/webpack/tests/__snapshots__/default.test.ts.snap b/packages/compat/webpack/tests/__snapshots__/default.test.ts.snap index 9479ef6d5a..5a5923ddb8 100644 --- a/packages/compat/webpack/tests/__snapshots__/default.test.ts.snap +++ b/packages/compat/webpack/tests/__snapshots__/default.test.ts.snap @@ -307,6 +307,9 @@ exports[`applyDefaultPlugins > should apply default plugins correctly 1`] = ` }, DefinePlugin { "definitions": { + "import.meta.env.DEV": true, + "import.meta.env.MODE": ""development"", + "import.meta.env.PROD": false, "process.env.ASSET_PREFIX": """", }, }, @@ -667,6 +670,9 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when produ }, DefinePlugin { "definitions": { + "import.meta.env.DEV": false, + "import.meta.env.MODE": ""production"", + "import.meta.env.PROD": true, "process.env.ASSET_PREFIX": """", }, }, @@ -971,6 +977,9 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when targe RsbuildCorePlugin {}, DefinePlugin { "definitions": { + "import.meta.env.DEV": false, + "import.meta.env.MODE": ""production"", + "import.meta.env.PROD": true, "process.env.ASSET_PREFIX": """", }, }, @@ -1258,6 +1267,9 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when targe RsbuildCorePlugin {}, DefinePlugin { "definitions": { + "import.meta.env.DEV": false, + "import.meta.env.MODE": ""production"", + "import.meta.env.PROD": true, "process.env.ASSET_PREFIX": """", }, }, diff --git a/packages/compat/webpack/tests/__snapshots__/webpackConfig.test.ts.snap b/packages/compat/webpack/tests/__snapshots__/webpackConfig.test.ts.snap index bcb67583cf..4e6835881b 100644 --- a/packages/compat/webpack/tests/__snapshots__/webpackConfig.test.ts.snap +++ b/packages/compat/webpack/tests/__snapshots__/webpackConfig.test.ts.snap @@ -70,6 +70,9 @@ exports[`webpackConfig > should allow to append and prepend plugins 1`] = ` }, DefinePlugin { "definitions": { + "import.meta.env.DEV": false, + "import.meta.env.MODE": ""none"", + "import.meta.env.PROD": false, "process.env.ASSET_PREFIX": """", }, }, diff --git a/packages/core/tests/__snapshots__/builder.test.ts.snap b/packages/core/tests/__snapshots__/builder.test.ts.snap index 9b3ad15f72..b998d06e40 100644 --- a/packages/core/tests/__snapshots__/builder.test.ts.snap +++ b/packages/core/tests/__snapshots__/builder.test.ts.snap @@ -367,6 +367,9 @@ exports[`should use rspack as default bundler > apply rspack correctly 1`] = ` DefinePlugin { "_args": [ { + "import.meta.env.DEV": true, + "import.meta.env.MODE": ""development"", + "import.meta.env.PROD": false, "process.env.ASSET_PREFIX": """", }, ], diff --git a/packages/core/tests/__snapshots__/default.test.ts.snap b/packages/core/tests/__snapshots__/default.test.ts.snap index 2801bf35e7..fce6d3fc45 100644 --- a/packages/core/tests/__snapshots__/default.test.ts.snap +++ b/packages/core/tests/__snapshots__/default.test.ts.snap @@ -367,6 +367,9 @@ exports[`applyDefaultPlugins > should apply default plugins correctly 1`] = ` DefinePlugin { "_args": [ { + "import.meta.env.DEV": true, + "import.meta.env.MODE": ""development"", + "import.meta.env.PROD": false, "process.env.ASSET_PREFIX": """", }, ], @@ -817,6 +820,9 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when prod DefinePlugin { "_args": [ { + "import.meta.env.DEV": false, + "import.meta.env.MODE": ""production"", + "import.meta.env.PROD": true, "process.env.ASSET_PREFIX": """", }, ], @@ -1152,6 +1158,9 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when targe DefinePlugin { "_args": [ { + "import.meta.env.DEV": true, + "import.meta.env.MODE": ""development"", + "import.meta.env.PROD": false, "process.env.ASSET_PREFIX": """", }, ], @@ -1557,6 +1566,9 @@ exports[`tools.rspack > should match snapshot 1`] = ` DefinePlugin { "_args": [ { + "import.meta.env.DEV": true, + "import.meta.env.MODE": ""development"", + "import.meta.env.PROD": false, "process.env.ASSET_PREFIX": """", }, ], diff --git a/packages/core/tests/__snapshots__/environments.test.ts.snap b/packages/core/tests/__snapshots__/environments.test.ts.snap index fe829b2fe4..45336da24d 100644 --- a/packages/core/tests/__snapshots__/environments.test.ts.snap +++ b/packages/core/tests/__snapshots__/environments.test.ts.snap @@ -1684,6 +1684,9 @@ exports[`environment config > tools.rspack / bundlerChain can be used in environ DefinePlugin { "_args": [ { + "import.meta.env.DEV": true, + "import.meta.env.MODE": ""development"", + "import.meta.env.PROD": false, "process.env.ASSET_PREFIX": """", }, ], @@ -2000,6 +2003,9 @@ exports[`environment config > tools.rspack / bundlerChain can be used in environ DefinePlugin { "_args": [ { + "import.meta.env.DEV": true, + "import.meta.env.MODE": ""development"", + "import.meta.env.PROD": false, "process.env.ASSET_PREFIX": """", }, ], diff --git a/packages/plugin-react/tests/__snapshots__/index.test.ts.snap b/packages/plugin-react/tests/__snapshots__/index.test.ts.snap index c00ff9b086..88bf9b9230 100644 --- a/packages/plugin-react/tests/__snapshots__/index.test.ts.snap +++ b/packages/plugin-react/tests/__snapshots__/index.test.ts.snap @@ -402,6 +402,9 @@ exports[`plugins/react > should work with swc-loader 1`] = ` DefinePlugin { "_args": [ { + "import.meta.env.DEV": true, + "import.meta.env.MODE": ""development"", + "import.meta.env.PROD": false, "process.env.ASSET_PREFIX": """", }, ], diff --git a/packages/plugin-vue/tests/__snapshots__/index.test.ts.snap b/packages/plugin-vue/tests/__snapshots__/index.test.ts.snap index 7ade442760..688853cbd2 100644 --- a/packages/plugin-vue/tests/__snapshots__/index.test.ts.snap +++ b/packages/plugin-vue/tests/__snapshots__/index.test.ts.snap @@ -78,6 +78,9 @@ DefinePlugin { "__VUE_OPTIONS_API__": true, "__VUE_PROD_DEVTOOLS__": false, "__VUE_PROD_HYDRATION_MISMATCH_DETAILS__": false, + "import.meta.env.DEV": false, + "import.meta.env.MODE": ""none"", + "import.meta.env.PROD": false, "process.env.ASSET_PREFIX": """", }, ],