mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 17:51:13 +08:00
feat(componentLoader): Add external component loader module
For render hijacking to work, imports need to be peformed at core level. This loader ensures that Webpack is able to resolve the paths to the external components' code, without the need for extra loaders or custom built plugins. Signed-off-by: Adrian Oprea <adrian@oprea.rocks>
This commit is contained in:
parent
ed44762ff2
commit
894e0afd0a
3 changed files with 9 additions and 0 deletions
0
app/javascript/src/componentLoader/components/.gitkeep
Normal file
0
app/javascript/src/componentLoader/components/.gitkeep
Normal file
3
app/javascript/src/componentLoader/config.js
Normal file
3
app/javascript/src/componentLoader/config.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
export default {
|
||||
|
||||
}
|
6
app/javascript/src/componentLoader/index.js
Normal file
6
app/javascript/src/componentLoader/index.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
import { createLoader } from 'react-hijack';
|
||||
|
||||
const componentLoader = createLoader((module) => import('' + module));
|
||||
|
||||
export default componentLoader;
|
||||
|
Loading…
Reference in a new issue