webpack如何在HTML页面中使用include?

比如index.html
'./head.html'

index

'./footer.html'
生成出来之后是
Document

index

html-loader貌似不能做到这种
慕桂英4014372
浏览 1298回答 2
2回答

婷婷同学_

安装cnpminstallhtml-loader--save-dev;

人到中年有点甜

Thebestintegrationwithwebpackandyourindex.htmlfile,wouldbehtml-webpack-plugin.Notonlydoesitinjectcss/javascriptbundlesintoatemplatedhtmlfile.Butitalsogivesyoufine-grainedcontrol.Ifyouaretryingtousemultipletemplatesandincludethemintoeachother,thenyoumaywanttolookintoadifferenttemplatinglanguagelikePug/JadeorHandlebars.(Eachofthesehavespecificwebpackloadersfortheirrespectivetypes).
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript