I have the following structure of my app:(我的应用程序具有以下结构:)
index.js(index.js)
const app = require("./app")
exports.api = app(...)
app.js(app.js)
//all the imports goes here
//and exporting the main function
module.exports = app => {...}
Now I need to bundle app.js
with webpack but index.js
must stay intact(现在我需要将app.js
与webpack捆绑在一起,但index.js
必须保持完整)
The question is, after bundling the app.js
, how can I require
it's main function app
from index.js
?(问题是,将app.js
捆绑后,如何从index.js
require
它是主要功能app
?)
After webpacking app.js
I'm getting error in index.js
that says "app is not a function" which makes sense since app.js content is now wrapped in webpack staff.(对app.js
进行网络打包后,在index.js
中出现错误,提示“ app不是函数”,这是有道理的,因为app.js内容现已包装在webpack员工中。)
Any suggestions are much appreciated.(任何建议,不胜感激。)
ask by vir us translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…