File tree 5 files changed +23
-0
lines changed
turbopack/crates/turbopack-tests/tests/execution/turbopack/side-effects-optimization/directive
5 files changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { foo } from './lib/index.js'
2
+
3
+ it ( 'should respect side effects directive' , ( ) => {
4
+ expect ( foo ) . toBe ( 789 )
5
+
6
+ const modules = Object . keys ( __turbopack_modules__ )
7
+ expect ( modules ) . toContainEqual ( expect . stringContaining ( 'input/lib/foo' ) )
8
+ expect ( modules ) . not . toContainEqual ( expect . stringContaining ( 'input/lib/index' ) )
9
+ expect ( modules ) . not . toContainEqual ( expect . stringContaining ( 'input/lib/bar' ) )
10
+ } )
Original file line number Diff line number Diff line change
1
+ "use turbopack no side effects"
2
+
3
+ export const bar = 123 ;
Original file line number Diff line number Diff line change
1
+ "use turbopack no side effects"
2
+
3
+ export const foo = 789 ;
Original file line number Diff line number Diff line change
1
+ "use turbopack no side effects"
2
+
3
+ export { foo } from "./foo" ;
4
+ export { bar } from "./bar" ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "treeShakingMode" : " reexports-only"
3
+ }
You can’t perform that action at this time.
0 commit comments