It seems to me that I'm trying to achieve, it is not so difficult .., but the documents in the web package are in a serious mess, and I burn many hours on it.
How do I add a “dynamic” module to a webpack assembly? I want to create this module at build time.
For a simple example, how do I insert this line as a new module during assembly?
"module.exports = new Date();"
Then let's say that I want this module to have the name "myDate"
I would really like any other module in my application to be able to resolve it with:
var myDate = require('myDate');
Now this is a very simple example. My goal will be much more complicated and include reading files to create this “dynamic” module. I know the define plugin and, unfortunately, is not suitable for my needs.
I would really appreciate any help. Thank.
source
share