//webpack.config.jsmodule.exports = {
entry: {
index: './index.js'
},
output: {
filename: '[name].js'
}
};如上所示,入口文件为index.js,在index.js的同级目录下还有main.css、logo.png等文件,现在需要在index.js中require其它文件并进行webpack编译最终打包成一个文件:
//index.jsrequire('main.css');require('logo.png');以上的需求是在不能手动更改index.js及不生成新的入口文件前提下,在webpack的编译中是否可以动态实现这个功能,比如使用plugin?求解,谢谢!!
蝴蝶刀刀
呼如林
蓝山帝景
随时随地看视频慕课网APP