react-dynamic-multi-render
Advanced tools
Comparing version 0.2.4 to 0.3.0
@@ -25,3 +25,3 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty'; | ||
const templateName = (_ref = templateConfig ? Array.isArray(templateConfig[componentName]) ? templateConfig[componentName][0] : templateConfig[componentName] : undefined) !== null && _ref !== void 0 ? _ref : 'standard'; | ||
const indexFilePath = `${templateName}`; | ||
const indexFilePath = `${templateName}/index`; | ||
const fullRelativeIndexPath = `${componentName}/${indexFilePath}`; | ||
@@ -126,3 +126,4 @@ return fullRelativeIndexPath; | ||
importFactory | ||
}); | ||
}); // File extenion needed! | ||
const Component = /*#__PURE__*/lazy(() => importFactory(fullRelativeIndexPath)); | ||
@@ -243,4 +244,3 @@ return Component; | ||
export default DynamicMultiRender; | ||
export { DynamicMultiRenderProvider, useDynamicMultiRenderConfig }; | ||
export { DynamicMultiRenderProvider, DynamicMultiRender as default, useDynamicMultiRenderConfig }; | ||
//# sourceMappingURL=index.js.map |
@@ -6,2 +6,22 @@ # Change Log | ||
# [0.3.0](https://github.com/Crystal-Design-GmbH/react-dynamic-multi-render/compare/react-dynamic-multi-render@0.2.4...react-dynamic-multi-render@0.3.0) (2021-08-23) | ||
### Bug Fixes | ||
* invalid package.json ([01af757](https://github.com/Crystal-Design-GmbH/react-dynamic-multi-render/commit/01af75723c52367b976a1f8534dc1177dfd90350)) | ||
* fix!: adjust dynamic import to new rollup plugin ([df6a144](https://github.com/Crystal-Design-GmbH/react-dynamic-multi-render/commit/df6a14435bd62689dc27dcd74ac384b383c16e41)) | ||
### BREAKING CHANGES | ||
* You need to append the file extension in the dynamic | ||
import factory! | ||
## [0.2.4](https://github.com/Crystal-Design-GmbH/react-dynamic-multi-render/compare/react-dynamic-multi-render@0.2.3...react-dynamic-multi-render@0.2.4) (2021-07-13) | ||
@@ -8,0 +28,0 @@ |
{ | ||
"name": "react-dynamic-multi-render", | ||
"version": "0.2.4", | ||
"version": "0.3.0", | ||
"license": "MIT", | ||
@@ -17,3 +17,3 @@ "devDependencies": { | ||
"types": "./build/types/index.d.ts", | ||
"gitHead": "9e1d4d9fc8373005b84cb13728d98037d71e915b" | ||
"gitHead": "d6863a184a56443b3aaff3ac03487e72573e2795" | ||
} |
@@ -32,3 +32,3 @@ # React Dynamic Multi Render | ||
}, | ||
importFactory: (path) => import(`../template/${path}`), | ||
importFactory: (path) => import(`../template/${path}.tsx`), | ||
}; | ||
@@ -86,6 +86,8 @@ | ||
// ... | ||
importFactory: (path) => import(`../template/${path}`), | ||
importFactory: (path) => import(`../template/${path}.tsx`), | ||
}; | ||
``` | ||
__Important!__ Mind the `.tsx` file extension! | ||
This will create a lazy-loadable chunk for every resolvable file inside the `template` folder. | ||
@@ -92,0 +94,0 @@ |
Sorry, the diff of this file is not supported yet
42382
245
324