1
1
mirror of https://github.com/c8r/x0.git synced 2024-09-11 21:57:26 +03:00

Adjust modules capturing

This commit is contained in:
Brent Jackson 2018-01-10 17:30:13 -05:00
parent 4a102cb21d
commit 60f6fb9c61
3 changed files with 5 additions and 6 deletions

View File

@ -8,4 +8,4 @@
background-color: #fff;
-webkit-font-smoothing: antialiased;
}
</style></head><div class="nanov6vxax"><nav><div class="nanosx9e3b"><a href="https://compositor.io" class="nanoxi0jei"><div class="nano1u2e98s"><div class="nano1pdbqw0">Compositor</div><style>.nano1pdbqw0{font-size:10px}.nano1pdbqw0{font-weight:600}.nano1pdbqw0{text-transform:uppercase;letter-spacing:.2em}</style></div><style>.nano1u2e98s{margin-left:-8px}.nano1u2e98s{display:flex}.nano1u2e98s{align-items:center}</style></a><style>.nanoxi0jei{display:block;color:inherit;text-decoration:none}</style><div class="nano1grpzsw"></div><style>.nano1grpzsw{margin-left:auto;margin-right:auto}</style><a href="https://github.com/c8r/x0" class="nanooiywwh">GitHub</a><style>.nanooiywwh{text-decoration:none;display:inline-block;font-weight:bold;text-transform:uppercase;letter-spacing:0.2em;padding:8px;color:inherit}.nanooiywwh{font-size:10px}.nanooiywwh{margin-right:8px}</style></div><style>.nanosx9e3b{display:flex}.nanosx9e3b{align-items:center}.nanosx9e3b{flex-wrap:wrap}</style></nav><header><div class="nano1l7e2jv"><h1 m="0" class="nano150ti37">x0</h1><style>.nano150ti37{font-size:64px;font-weight:600;line-height:1.25}.nano150ti37{margin:0px}</style><div class="nano1uksl6t">Zero-config React development environment and static site generator</div><style>.nano1uksl6t{font-size:20px}.nano1uksl6t{font-weight:600}.nano1uksl6t{margin-bottom:16px}</style><div class="nano1nucgho">v3.0.4</div><style>.nano1nucgho{font-size:12px}.nano1nucgho{font-family:"Roboto Mono", Menlo, monospace}</style></div><style>.nano1l7e2jv{padding-bottom:32px;padding-top:64px}</style></header><main><div class="nano1bykfi2"><video loop="" autoplay="" src="demo.mp4" class="nano5m3rv9"></video><style>.nano5m3rv9{display:block;width:100%;height:auto;margin:0}</style></div><div class="nanoq0vyd3"><pre class="nanorwxul5">npm install @compositor/x0</pre><style>.nanorwxul5{font-family:"Roboto Mono", Menlo, monospace;margin:0;padding:0}.nanorwxul5{font-size:14px}</style></div><style>.nanoq0vyd3{padding-top:32px;padding-bottom:32px}</style><section id="get-started"><div class="nanoq4qa9y"><div class="nano198h2e9">Get Started</div><style>.nano198h2e9{font-size:24px}.nano198h2e9{font-weight:600}</style><div class="nano1m6nlin">Read the docs and get started on GitHub or sign up for updates.</div><style>.nano1m6nlin{margin-bottom:32px}</style><a href="https://github.com/c8r/x0" class="nanop5q5kx">Documentation</a><style>.nanop5q5kx{display:inline-block;text-decoration:none;font-size:12px;font-weight:bold;text-transform:uppercase;letter-spacing:.2em;padding-top:12px;padding-bottom:12px;padding-left:24px;padding-right:24px;color:white;background-color:black;border:0;border-radius:8px}.nanop5q5kx{margin-right:16px}</style></div><style>.nanoq4qa9y{padding-top:64px;padding-bottom:64px}</style></section><footer><div class="nano1dfuwer"><div class="nano1g5hjxy">© 2017 Compositor, Inc.</div><style>.nano1g5hjxy{font-size:12px}</style></div><style>.nano1dfuwer{padding-bottom:32px;padding-top:64px}.nano1dfuwer{display:flex}</style></footer></main></div><style>.nanov6vxax{margin-left:auto;margin-right:auto;padding-left:16px;padding-right:16px}@media screen and (min-width: 40em){.nanov6vxax{padding-left:32px;padding-right:32px}}.nanov6vxax{max-width:768px}</style>
</style></head><div class="nanov6vxax"><nav><div class="nanosx9e3b"><a href="https://compositor.io" class="nanoxi0jei"><div class="nano1u2e98s"><div class="nano1pdbqw0">Compositor</div><style>.nano1pdbqw0{font-size:10px}.nano1pdbqw0{font-weight:600}.nano1pdbqw0{text-transform:uppercase;letter-spacing:.2em}</style></div><style>.nano1u2e98s{margin-left:-8px}.nano1u2e98s{display:flex}.nano1u2e98s{align-items:center}</style></a><style>.nanoxi0jei{display:block;color:inherit;text-decoration:none}</style><div class="nano1grpzsw"></div><style>.nano1grpzsw{margin-left:auto;margin-right:auto}</style><a href="https://github.com/c8r/x0" class="nanooiywwh">GitHub</a><style>.nanooiywwh{text-decoration:none;display:inline-block;font-weight:bold;text-transform:uppercase;letter-spacing:0.2em;padding:8px;color:inherit}.nanooiywwh{font-size:10px}.nanooiywwh{margin-right:8px}</style></div><style>.nanosx9e3b{display:flex}.nanosx9e3b{align-items:center}.nanosx9e3b{flex-wrap:wrap}</style></nav><header><div class="nano1l7e2jv"><h1 m="0" class="nano150ti37">x0</h1><style>.nano150ti37{font-size:64px;font-weight:600;line-height:1.25}.nano150ti37{margin:0px}</style><div class="nano1uksl6t">Zero-config React development environment and static site generator</div><style>.nano1uksl6t{font-size:20px}.nano1uksl6t{font-weight:600}.nano1uksl6t{margin-bottom:16px}</style><div class="nano1nucgho">v3.1.0-1</div><style>.nano1nucgho{font-size:12px}.nano1nucgho{font-family:"Roboto Mono", Menlo, monospace}</style></div><style>.nano1l7e2jv{padding-bottom:32px;padding-top:64px}</style></header><main><div class="nano1bykfi2"><video loop="" autoplay="" src="demo.mp4" class="nano5m3rv9"></video><style>.nano5m3rv9{display:block;width:100%;height:auto;margin:0}</style></div><div class="nanoq0vyd3"><pre class="nanorwxul5">npm install @compositor/x0</pre><style>.nanorwxul5{font-family:"Roboto Mono", Menlo, monospace;margin:0;padding:0}.nanorwxul5{font-size:14px}</style></div><style>.nanoq0vyd3{padding-top:32px;padding-bottom:32px}</style><section id="get-started"><div class="nanoq4qa9y"><div class="nano198h2e9">Get Started</div><style>.nano198h2e9{font-size:24px}.nano198h2e9{font-weight:600}</style><div class="nano1m6nlin">Read the docs and get started on GitHub or sign up for updates.</div><style>.nano1m6nlin{margin-bottom:32px}</style><a href="https://github.com/c8r/x0" class="nanop5q5kx">Documentation</a><style>.nanop5q5kx{display:inline-block;text-decoration:none;font-size:12px;font-weight:bold;text-transform:uppercase;letter-spacing:.2em;padding-top:12px;padding-bottom:12px;padding-left:24px;padding-right:24px;color:white;background-color:black;border:0;border-radius:8px}.nanop5q5kx{margin-right:16px}</style></div><style>.nanoq4qa9y{padding-top:64px;padding-bottom:64px}</style></section><footer><div class="nano1dfuwer"><div class="nano1g5hjxy">© 2017 Compositor, Inc.</div><style>.nano1g5hjxy{font-size:12px}</style></div><style>.nano1dfuwer{padding-bottom:32px;padding-top:64px}.nano1dfuwer{display:flex}</style></footer></main></div><style>.nanov6vxax{margin-left:auto;margin-right:auto;padding-left:16px;padding-right:16px}@media screen and (min-width: 40em){.nanov6vxax{padding-left:32px;padding-right:32px}}.nanov6vxax{max-width:768px}</style>

View File

@ -41,9 +41,7 @@ const createHTML = ({
const propsScript = initialProps =>
initialProps ? `<script id="__initial-props__" type="application/json">${JSON.stringify(initialProps)}</script>` : ''
const modules = []
const render = (Component, props, isStatic) =>
const render = (Component, props, isStatic, modules = []) =>
(isStatic ? renderToStaticMarkup : renderToString)(
React.createElement(Loadable.Capture, {
report: mod => modules.push(mod)
@ -53,6 +51,7 @@ const render = (Component, props, isStatic) =>
)
const renderHTML = async (Component, options) => {
const modules = []
const isStatic = options.static || !options.outDir
const base = options.basename || ''
const script = base + '/bundle.js'
@ -64,7 +63,7 @@ const renderHTML = async (Component, options) => {
const props = Object.assign({}, options, initialProps)
const preloaded = await Loadable.preloadAll()
const body = render(Component, props, isStatic)
const body = render(Component, props, isStatic, modules)
const loadableStats = require('./TMP/react-loadable.json')
const bundles = isStatic ? [] : getBundles(loadableStats, modules)

View File

@ -1,6 +1,6 @@
{
"name": "@compositor/x0",
"version": "3.0.4",
"version": "3.1.0-1",
"description": "Zero-config React development environment and static site generator",
"main": "index.js",
"bin": {