अपडेट - संबंधित: How to prepend module.exports =
to webpack bundle?वेबपैक बंडल की आवश्यकता है - खाली वस्तु लौटाता है?
मैं webpack संकलन है एक सरल module.exports = "asdfasdf"
करने के लिए foo.js
एक नोड server.js
मैं var foo = require("./foo.js")
है जब मैं console.log(foo)
मैं एक खाली वस्तु पाने में {}
मैं क्या गलत कर रहा हूँ ??
मेरे webpack config:
module.exports = {
entry: "./test.js",
output: {
filename: "./foo.js"
},
target: "node",
module: {
loaders: [
{
exclude: /(node_modules|bower_components)/,
loader: "babel?presets[]=react,presets[]=es2015"
}
]
},
devtool: "#source-map"
};
क्या आप संकलित 'foo.js' की सामग्री पोस्ट कर सकते हैं? – TN1ck