Closed btkostner closed 8 years ago
Hi @btkostner! Thanks for catching this.
Quick fix: just pass locals: {}
to your reshape config and it will be resolved. Example:
reshape: (ctx) => {
return htmlStandards({ webpack: ctx, locals: {} })
}
Long explanation: What you see there is actually a javascript function that, if called, would output your template's contents. Reshape can generate client-side templates as well (which is very useful for building more complex apps), and by default, this is what the reshape loader for webpack will output. When you pass the loader any locals
config, it switches to generating static html instead.
The Fix: Since this particular pipeline within spike more or less always requires that the output be static html, I'll make it such that the primary reshape config always sets the locals
config, even if the user removes it. I'll close out this issue and link to the fix once this has been resolved 😁
Much appreciated @jescalan
cheers!
Webpack fails to build HTML when there are non-existent locals
Creating a new spike project, and remove the locals part of
app.js
so it looks like such:Run
spike compile
orspike watch
and it will show normal output:But the generated HTML file will include webpack output:
At very least, it should show a warning on build. At best it should skip over that variable, or flat out error on build.
:earth_americas: environment