diff --git a/README.md b/README.md index 3673ffa..b6e646a 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ dist/ <-- `npm run build` app src/ <-- your source code css/ <-- processed css files js/ <-- processed javascript files + registry.js <-- global component registry public/ <-- unprocessed static `/` assets components/ <-- riots components hello-riot/ @@ -68,7 +69,7 @@ This template uses a static object registry to mount global **components** which ``` -> SEE: `/src/index.js` for more information +> SEE: `/src/index.js` & `/src/js/registry.js` for more information ### Tests diff --git a/src/index.js b/src/index.js index 80a4fc1..f3c041a 100644 --- a/src/index.js +++ b/src/index.js @@ -1,10 +1,2 @@ -import {Register} from './js/register.js'; -import HelloRiot from './components/hello-riot/hello-riot.riot'; - -// define global components here -const registry = { - 'hello-riot': HelloRiot -}; - -// register global components -Register(registry); +// bootstraps global components +import './js/registery.js'; diff --git a/src/js/register.js b/src/js/registery.js similarity index 67% rename from src/js/register.js rename to src/js/registery.js index 502a852..c8cc205 100644 --- a/src/js/register.js +++ b/src/js/registery.js @@ -1,4 +1,5 @@ import {register, mount} from 'riot'; +import HelloRiot from '../components/hello-riot/hello-riot.riot'; /** * Register Global Components @@ -20,4 +21,10 @@ export function Register(registry = {}) { }); } -export default Register; +// define global components here +const registry = { + 'hello-riot': HelloRiot +}; + +// export registered global components +export default Register(registry);