I'm feeling a bit frustrated because what I am trying to accomplish doesn't seem too difficult, but the documentation for webpack is so disorganized that it's eating up a lot of my time.
Can someone please explain how I can inject a "dynamic" module into a webpack build? I need to create this module during the build process.
Just to give a simple example, how do I add this string as a new module in the build?
"module.exports = new Date();"
Let's say I want to name this module "myDate".
I'd like any other module in my application to be able to access it with:
var myDate = require('myDate');
This example may be straightforward, but my actual use case will involve more complexity - such as reading files to generate this "dynamic" module. The define plugin isn't suitable for my requirements.
Any assistance would be greatly appreciated. Thank you.