diff --git a/webpack-test/configCases/optimization/runtime-specific-used-exports/test.filter.js b/webpack-test/configCases/optimization/runtime-specific-used-exports/test.filter.js index 3be456dcd23..8e5c51af343 100644 --- a/webpack-test/configCases/optimization/runtime-specific-used-exports/test.filter.js +++ b/webpack-test/configCases/optimization/runtime-specific-used-exports/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => {return true} diff --git a/webpack-test/configCases/optimization/runtime-specific-used-exports2/node_modules/root1/index.js b/webpack-test/configCases/optimization/runtime-specific-used-exports2/node_modules/root1/index.js new file mode 100644 index 00000000000..7d4533e46be --- /dev/null +++ b/webpack-test/configCases/optimization/runtime-specific-used-exports2/node_modules/root1/index.js @@ -0,0 +1,6 @@ +export const a = "a"; +export const b = "b"; +export const c = "c"; +export const aUsed = __webpack_exports_info__.a.used; +export const bUsed = __webpack_exports_info__.b.used; +export const cUsed = __webpack_exports_info__.c.used; diff --git a/webpack-test/configCases/optimization/runtime-specific-used-exports2/node_modules/root2/index.js b/webpack-test/configCases/optimization/runtime-specific-used-exports2/node_modules/root2/index.js new file mode 100644 index 00000000000..524350cd31b --- /dev/null +++ b/webpack-test/configCases/optimization/runtime-specific-used-exports2/node_modules/root2/index.js @@ -0,0 +1,6 @@ +export const d = "d"; +export const e = "e"; +export const f = "f"; +export const dUsed = __webpack_exports_info__.d.used; +export const eUsed = __webpack_exports_info__.e.used; +export const fUsed = __webpack_exports_info__.f.used; diff --git a/webpack-test/configCases/optimization/runtime-specific-used-exports2/webpack.config.js b/webpack-test/configCases/optimization/runtime-specific-used-exports2/webpack.config.js index 0895dba239b..d7ff8eeb2f5 100644 --- a/webpack-test/configCases/optimization/runtime-specific-used-exports2/webpack.config.js +++ b/webpack-test/configCases/optimization/runtime-specific-used-exports2/webpack.config.js @@ -4,8 +4,14 @@ module.exports = { filename: "[name].js" }, target: "node", + experiments: { + rspackFuture: { + newTreeshaking: true + } + }, optimization: { chunkIds: "named", + usedExports: true, splitChunks: { chunks: "all", cacheGroups: { diff --git a/webpack-test/configCases/output/inner-dirs-entries/node_modules/dummy_module/index.js b/webpack-test/configCases/output/inner-dirs-entries/node_modules/dummy_module/index.js new file mode 100644 index 00000000000..bb16bd21190 --- /dev/null +++ b/webpack-test/configCases/output/inner-dirs-entries/node_modules/dummy_module/index.js @@ -0,0 +1,3 @@ +export default function someDummyFunction() { + return "this is just a dummy function"; +} diff --git a/webpack-test/configCases/output/inner-dirs-entries/test.filter.js b/webpack-test/configCases/output/inner-dirs-entries/test.filter.js index 3be456dcd23..8e5c51af343 100644 --- a/webpack-test/configCases/output/inner-dirs-entries/test.filter.js +++ b/webpack-test/configCases/output/inner-dirs-entries/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => {return true}