Closed eldh closed 9 years ago
Maybe we have been thinking this the wrong way. If you want to include scripts to some specific page or post, you'll probably want to author it in jsx or some variant anyway (yaml headmatter included). In that case require
can deal with the problem for us (I think the current resolve path configuration might be enough). We just need to make sure the core can deal with components like this. This would sound like a good starting point to me.
The potential problem here is that writing the actual post would get a little harder but I have a feeling loaders could help here too.
In short we can probably make this Webpack's problem, not ours.
We can include scripts using dangerouslySetInnerHTML
already (it's done in default-theme Body). And we can also reference script files in assets.
We also want the isomorphic react bit to work though. For example to allow search components to be written in pure react.
Maybe close this and open another issue for the isomorphic stuff though.
Closing. There's #16 for the isomorphic bit.
There's currently no nice way to create dynamic pages (that include scripts in some form). This needs to be fixed, naturally.
I don't know which is the best approach, but generating entrypoints for webpack is an idea worth investigating.