We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sideEffect: true
// farm.config.ts import { defineConfig } from '@farmfe/core'; export default defineConfig({ compilation: { output: { targetEnv: 'library-node', }, input: { index: './index.ts', }, minify: false, mode: 'development', persistentCache: false, }, plugins: [ { name: 'sideEffect', resolve: { filters: { sources: ['.+'], importers: ['.+'], }, executor(param, context, hookContext) { console.log(param); if (param.source === 'virtual:foo') return { sideEffects: true, resolvedPath: 'virtual:foo', }; return undefined; }, }, load: { filters: { resolvedPaths: ['.+'], }, executor(param, context, hookContext) { if (param.resolvedPath === 'virtual:foo') return { content: 'export const name = 1', moduleType: 'js', }; }, }, }, ], });
import 'virtual:foo'; console.log('foo');
No response
When virtual:foo has sideEffect set to true it should be preserved
virtual:foo
System: OS: Linux 6.10 Arch Linux CPU: (32) x64 Intel(R) Core(TM) i9-14900HX Memory: 10.45 GB / 31.07 GB Container: Yes Shell: 5.9 - /bin/zsh Binaries: Node: 22.3.0 - /run/user/1000/fnm_multishells/84882_1717558110082/bin/node Yarn: 1.22.22 - ~/.local/share/pnpm/yarn npm: 10.8.1 - /run/user/1000/fnm_multishells/84882_1717558110082/bin/npm pnpm: 9.6.0 - ~/.local/share/pnpm/pnpm bun: 1.1.16 - ~/.bun/bin/bun npmPackages: @farmfe/core: ^1.3.24 => 1.3.24
The text was updated successfully, but these errors were encountered:
support disable tree shake for specified module in 2.0
Sorry, something went wrong.
No branches or pull requests
Steps to reproduce
Reproduce link
No response
What is actually happening?
When
virtual:foo
has sideEffect set to true it should be preservedSystem Info
The text was updated successfully, but these errors were encountered: