RT 多頁面目錄結構看了很多種。。主要的大概有下面這些
第一種:一個頁面一個文件夾,內部包含所有依賴
webpack-project //項目根目錄
--src //開發目錄 -index //主頁的目錄 +index.html +images +js +css -about //about頁面的目錄(內部和上面index一樣) -works //同上 -contact //同上 --dist //發布目錄 -內容就是用html-webpack-plugin生成的和src一樣的結構 --package.json --mode_moudule ...
第二種:HTML都扔模板目錄,js/css/image等資源放另外目錄
webpack-project //項目根目錄
--src //開發目錄 -views //HTML模塊目錄,所有的HTML頁面都塞進去 +index.html +about.html +contact.html -css -js +index.js +about.js +contact.js +components //其他的js片段 -images --dist //發布目錄 --內容就是用html-webpack-plugin生成的和src一樣的結構 --package.json --mode_moudule ...
第三種:不使用html-webpack-plugin生成html,html直接引用dist里的打包后資源
webpack-project //項目根目錄
--src //開發目錄 -css -js +index.js +about.js +contact.js +components //其他的js片段 -images --dist //發布目錄 -css -js -images --package.json --mode_moudule --index.html --about.html --contact.html