Skip to content
New issue

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

你研究过多层export import 后的tree-shaking么,隔一层里面的context没有tree-shaking #1

Open
shinken008 opened this issue Aug 5, 2020 · 0 comments

Comments

@shinken008
Copy link

// App.js 入口文件
import { cube, Test } from './utils.js';

// cube(2);
// middle.js
console.log('before middle'); // 会被摇掉
// 类消除
export class Test {
  getName(){
    return 'test';
  }
}
// 函数消除
export { cube } from './utils'
// utils.js
console.log('before utils');// 不会被摇掉

export function square(x) {
  console.log('square'); 
  return x * x;
}

export function cube(x) {
  console.log('cube');
  return x * x * x;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant