feat: export icestore types (#212)

* feat: export icestore types

* fix: export IcestoreRootState and IcestoreDispatch
This commit is contained in:
chenbin92 2020-04-07 11:22:24 +08:00 committed by GitHub
parent 707fac20ec
commit 30c09a6ad7
2 changed files with 7 additions and 2 deletions

View File

@ -13,8 +13,10 @@ export default async (api) => {
const pageStoresTemplatePath = path.join(templatePath, 'pageStores.ts.ejs');
const projectType = getValue('PROJECT_TYPE');
await fse.copy(path.join(__dirname, '..', 'src/types/index.ts'), path.join(targetPath, './types/store.ts'));
applyMethod('addIceTypesExport', { source: './types/store', specifier: '{ IStore }', exportName: 'store?: IStore' });
await fse.copy(path.join(__dirname, '..', 'src/types'), path.join(targetPath, './store'));
// TODO: 考虑合并为一个
applyMethod('addIceTypesExport', { source: './store', specifier: '{ IStore }', exportName: 'store?: IStore' });
applyMethod('addIceTypesExport', { source: './store/icestore' });
onGetWebpackConfig(config => {
if (command === 'build') {

View File

@ -0,0 +1,3 @@
import { IcestoreDispatch, IcestoreRootState } from '@ice/store';
export { IcestoreDispatch, IcestoreRootState };