Bundling js files with webpack class undefined

后端 未结 1 727
暖寄归人
暖寄归人 2021-01-21 04:25

Im bundling together the following files contents:

a.js:

class BaseC {
    doIt(){
        console.log(this);
    }
}

class A extends BaseC{
}
         


        
1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-21 04:31

    Try exporting the class from a.js: export class BaseC { ...

    and importing it into b.js: import {BaseC} from './a.js' ...

    0 讨论(0)
提交回复
热议问题