webpack.configCopy.jsx 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936
  1. const path = require('path');
  2. const HtmlWebpackPlugin = require('html-webpack-plugin');
  3. /*const HtmlWebpackInlineSourcePlugin=require('html-webpack-inline-source-plugin');*/
  4. const CleanWebpackPlugin = require('clean-webpack-plugin') // 清空打包目录的插件
  5. const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  6. const CopyWebpackPlugin = require('copy-webpack-plugin');
  7. const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
  8. const webpack = require('webpack');
  9. // const proxyHost = "http://192.168.2.236:5858";
  10. // const proxyHost = "http://173.18.12.195:5858";
  11. const proxyHost = "http://192.168.4.222:5858";
  12. // const proxyHost = "http://192.168.3.117:5858";//铁钢
  13. // const proxyHost = "http://192.168.3.113:5858";//王峰
  14. module.exports = {
  15. entry: {
  16. index: path.resolve(__dirname, 'src/js', 'index.js'),
  17. qcScore: path.resolve(__dirname, 'src/js', 'qcScore.js'),
  18. login: path.resolve(__dirname, 'src/js', 'login.js'),
  19. console: path.resolve(__dirname, 'src/js', 'console.js'),
  20. deptConsole: path.resolve(__dirname, 'src/js', 'deptConsole.js'),
  21. moduleManager: path.resolve(__dirname, 'src/js', 'moduleManager.js'),
  22. itemManager: path.resolve(__dirname, 'src/js', 'itemManager.js'),
  23. qcList: path.resolve(__dirname, 'src/js', 'qcList.js'),
  24. qcListDocteam: path.resolve(__dirname, 'src/js', 'qcListDocteam.js'),
  25. qcListDept: path.resolve(__dirname, 'src/js', 'qcListDept.js'),
  26. qcListPerson: path.resolve(__dirname, 'src/js', 'qcListPerson.js'),
  27. userManager: path.resolve(__dirname, 'src/js', 'userManager.js'),
  28. roleManager: path.resolve(__dirname, 'src/js', 'roleManager.js'),
  29. tiaomu: path.resolve(__dirname, 'src/js', 'tiaomu.js'),
  30. mukuai: path.resolve(__dirname, 'src/js', 'mukuai.js'),
  31. abnormal: path.resolve(__dirname, 'src/js', 'abnormal.js'),
  32. partDetail: path.resolve(__dirname, 'src/js', 'partDetail.js'),
  33. dayDetail: path.resolve(__dirname, 'src/js', 'dayDetail.js'),
  34. payDetail: path.resolve(__dirname, 'src/js', 'payDetail.js'),
  35. deptScoreDetail: path.resolve(__dirname, 'src/js', 'deptScoreDetail.js'),
  36. deptScoreDetailControl: path.resolve(__dirname, 'src/js', 'deptScoreDetailControl.js'),
  37. jiaji: path.resolve(__dirname, 'src/js', 'jiaji.js'),
  38. partDetailControl: path.resolve(__dirname, 'src/js', 'partDetailControl.js'),
  39. quexianXQ: path.resolve(__dirname, 'src/js', 'quexianXQ.js'),
  40. quexianDetail: path.resolve(__dirname, 'src/js', 'quexianDetail.js'),
  41. quexianDetailControl: path.resolve(__dirname, 'src/js', 'quexianDetailControl.js'),
  42. quexianDetailHome: path.resolve(__dirname, 'src/js', 'quexianDetailHome.js'),
  43. quexianDetailControlHome: path.resolve(__dirname, 'src/js', 'quexianDetailControlHome.js'),
  44. mukuaiControl: path.resolve(__dirname, 'src/js', 'mukuaiControl.js'),
  45. tiaomuControl: path.resolve(__dirname, 'src/js', 'tiaomuControl.js'),
  46. assertType: path.resolve(__dirname, 'src/js', 'assertType.js'),
  47. assertTypeDetail: path.resolve(__dirname, 'src/js', 'assertTypeDetail.js'),
  48. singleVeto: path.resolve(__dirname, 'src/js', 'singleVeto.js'),
  49. itemDefectDetail: path.resolve(__dirname, 'src/js', 'itemDefectDetail.js'),
  50. keyItemFlawControl: path.resolve(__dirname, 'src/js', 'keyItemFlawControl.js'),
  51. qualifiedPhysician: path.resolve(__dirname, 'src/js', 'qualifiedPhysician.js'),
  52. deptQualifiedPhysician: path.resolve(__dirname, 'src/js', 'deptQualifiedPhysician.js'),
  53. qcListCopy: path.resolve(__dirname, 'src/js', 'qcListCopy.js'),
  54. qcListCopyUnqualified: path.resolve(__dirname, 'src/js', 'qcListCopyUnqualified.js'),
  55. qcListOutHospital: path.resolve(__dirname, 'src/js', 'qcListOutHospital.js'),
  56. checkControl: path.resolve(__dirname, 'src/js', 'checkControl.js'),
  57. advice: path.resolve(__dirname, 'src/js', 'advice.js'),
  58. uncorrectedCasesStatistics: path.resolve(__dirname, 'src/js', 'uncorrectedCasesStatistics.js'),
  59. uncorrectedCopy: path.resolve(__dirname, 'src/js', 'uncorrectedCopy.js'),
  60. uccDetail: path.resolve(__dirname, 'src/js', 'uccDetail.js'),
  61. readmission: path.resolve(__dirname, 'src/js', 'readmission.js'),
  62. pacs: path.resolve(__dirname, 'src/js', 'pacs.js'),
  63. pacsDetail: path.resolve(__dirname, 'src/js', 'pacsDetail.js'),
  64. assist: path.resolve(__dirname, 'src/js', 'assist.js'),
  65. error: path.resolve(__dirname, 'src/js', 'error.js'),
  66. nursing: path.resolve(__dirname, 'src/js', 'nursing.js'),
  67. other: path.resolve(__dirname, 'src/js', 'other.js'),
  68. mentCenter: path.resolve(__dirname, 'src/js', 'mentCenter.js'),
  69. test: path.resolve(__dirname, 'src/js/dept', 'test.js'),
  70. partDetailControlDept: path.resolve(__dirname, 'src/js/dept', 'partDetailControlDept.js'),
  71. messageNoti: path.resolve(__dirname, 'src/js/dept', 'messageNoti.js'),
  72. vendor: 'lodash', //多个页面所需的公共库文件,防止重复打包带入
  73. },
  74. output: {
  75. publicPath: '/', //这里要放的是静态资源CDN的地址
  76. path: path.resolve(__dirname, 'dist'),
  77. filename: 'js/[name].js'
  78. },
  79. resolve: {
  80. extensions: [".js", ".css", ".json"],
  81. alias: {} //配置别名可以加快webpack查找模块的速度
  82. },
  83. plugins: [//多入口的html文件用chunks这个参数来区分
  84. new HtmlWebpackPlugin({
  85. title: 'test',
  86. template: path.resolve(__dirname, 'src/html/dept', 'test.html'),
  87. filename: 'test.html',
  88. chunks: ['test', 'vendor', 'common', 'src/resouce/dot.js'],
  89. hash: true, //防止缓存
  90. inject: true,
  91. minify: {
  92. removeAttributeQuotes: true, //压缩 去掉引号
  93. removeComments: true, //移除HTML中的注释
  94. collapseWhitespace: true //删除空白符与换行符
  95. }
  96. }),
  97. new HtmlWebpackPlugin({
  98. title: 'index',
  99. template: path.resolve(__dirname, 'src/html', 'index.html'),
  100. filename: 'index.html',
  101. chunks: ['index', 'vendor', 'common', 'scrollBar', 'src/resouce/dot.js'],
  102. hash: true, //防止缓存
  103. inject: true,
  104. minify: {
  105. removeAttributeQuotes: true, //压缩 去掉引号
  106. removeComments: true, //移除HTML中的注释
  107. collapseWhitespace: true //删除空白符与换行符
  108. }
  109. }),
  110. new HtmlWebpackPlugin({
  111. title: 'partDetailControlDept',
  112. template: path.resolve(__dirname, 'src/html/dept', 'partDetailControlDept.html'),
  113. filename: 'partDetailControlDept.html',
  114. chunks: ['partDetailControlDept', 'vendor', 'common'],
  115. hash: true, //防止缓存
  116. inject: true,
  117. minify: {
  118. removeAttributeQuotes: true, //压缩 去掉引号
  119. removeComments: true, //移除HTML中的注释
  120. collapseWhitespace: true //删除空白符与换行符
  121. }
  122. }),
  123. new HtmlWebpackPlugin({
  124. title: 'messageNoti',
  125. template: path.resolve(__dirname, 'src/html/dept', 'messageNoti.html'),
  126. filename: 'messageNoti.html',
  127. chunks: ['messageNoti', 'vendor', 'common'],
  128. hash: true, //防止缓存
  129. inject: true,
  130. minify: {
  131. removeAttributeQuotes: true, //压缩 去掉引号
  132. removeComments: true, //移除HTML中的注释
  133. collapseWhitespace: true //删除空白符与换行符
  134. }
  135. }),
  136. new HtmlWebpackPlugin({
  137. title: 'nursing',
  138. template: path.resolve(__dirname, 'src/html', 'nursing.html'),
  139. filename: 'nursing.html',
  140. chunks: ['nursing', 'vendor', 'common', 'scrollBar'],
  141. hash: true, //防止缓存
  142. inject: true,
  143. minify: {
  144. removeAttributeQuotes: true, //压缩 去掉引号
  145. removeComments: true, //移除HTML中的注释
  146. collapseWhitespace: true //删除空白符与换行符
  147. }
  148. }),
  149. new HtmlWebpackPlugin({
  150. title: 'other',
  151. template: path.resolve(__dirname, 'src/html', 'other.html'),
  152. filename: 'other.html',
  153. chunks: ['other', 'vendor', 'common', 'scrollBar'],
  154. hash: true, //防止缓存
  155. inject: true,
  156. minify: {
  157. removeAttributeQuotes: true, //压缩 去掉引号
  158. removeComments: true, //移除HTML中的注释
  159. collapseWhitespace: true //删除空白符与换行符
  160. }
  161. }),
  162. new HtmlWebpackPlugin({
  163. title: 'mentCenter',
  164. template: path.resolve(__dirname, 'src/html', 'mentCenter.html'),
  165. filename: 'mentCenter.html',
  166. chunks: ['mentCenter', 'vendor', 'common', 'scrollBar'],
  167. hash: true, //防止缓存
  168. inject: true,
  169. minify: {
  170. removeAttributeQuotes: true, //压缩 去掉引号
  171. removeComments: true, //移除HTML中的注释
  172. collapseWhitespace: true //删除空白符与换行符
  173. }
  174. }),
  175. new HtmlWebpackPlugin({
  176. title: 'error',
  177. template: path.resolve(__dirname, 'src/html', 'error.html'),
  178. filename: 'error.html',
  179. chunks: ['error', 'vendor', 'common'],
  180. hash: true, //防止缓存
  181. inject: true,
  182. minify: {
  183. removeAttributeQuotes: true, //压缩 去掉引号
  184. removeComments: true, //移除HTML中的注释
  185. collapseWhitespace: true //删除空白符与换行符
  186. }
  187. }),
  188. new HtmlWebpackPlugin({
  189. title: 'console.html',
  190. template: path.resolve(__dirname, 'src/html', 'console.html'),
  191. filename: 'console.html',
  192. chunks: ['console', 'vendor', 'common', 'scrollBar'],
  193. hash: true, //防止缓存
  194. inject: true,
  195. minify: {
  196. removeAttributeQuotes: true, //压缩 去掉引号
  197. removeComments: true, //移除HTML中的注释
  198. collapseWhitespace: true //删除空白符与换行符
  199. }
  200. }),
  201. new HtmlWebpackPlugin({
  202. title: 'uncorrectedCopy.html',
  203. template: path.resolve(__dirname, 'src/html', 'uncorrectedCopy.html'),
  204. filename: 'uncorrectedCopy.html',
  205. chunks: ['uncorrectedCopy', 'vendor', 'common', 'scrollBar'],
  206. hash: true, //防止缓存
  207. inject: true,
  208. minify: {
  209. removeAttributeQuotes: true, //压缩 去掉引号
  210. removeComments: true, //移除HTML中的注释
  211. collapseWhitespace: true //删除空白符与换行符
  212. }
  213. }),
  214. new HtmlWebpackPlugin({
  215. title: 'pacs.html',
  216. template: path.resolve(__dirname, 'src/html', 'pacs.html'),
  217. filename: 'pacs.html',
  218. chunks: ['pacs', 'vendor', 'common', 'scrollBar'],
  219. hash: true, //防止缓存
  220. inject: true,
  221. minify: {
  222. removeAttributeQuotes: true, //压缩 去掉引号
  223. removeComments: true, //移除HTML中的注释
  224. collapseWhitespace: true //删除空白符与换行符
  225. }
  226. }),
  227. new HtmlWebpackPlugin({
  228. title: 'pacsDetail.html',
  229. template: path.resolve(__dirname, 'src/html', 'pacsDetail.html'),
  230. filename: 'pacsDetail.html',
  231. chunks: ['pacsDetail', 'vendor', 'common', 'scrollBar'],
  232. hash: true, //防止缓存
  233. inject: true,
  234. minify: {
  235. removeAttributeQuotes: true, //压缩 去掉引号
  236. removeComments: true, //移除HTML中的注释
  237. collapseWhitespace: true //删除空白符与换行符
  238. }
  239. }),
  240. new HtmlWebpackPlugin({
  241. title: 'assist.html',
  242. template: path.resolve(__dirname, 'src/html', 'assist.html'),
  243. filename: 'assist.html',
  244. chunks: ['assist', 'vendor', 'common', 'scrollBar'],
  245. hash: true, //防止缓存
  246. inject: true,
  247. minify: {
  248. removeAttributeQuotes: true, //压缩 去掉引号
  249. removeComments: true, //移除HTML中的注释
  250. collapseWhitespace: true //删除空白符与换行符
  251. }
  252. }),
  253. new HtmlWebpackPlugin({
  254. title: 'advice.html',
  255. template: path.resolve(__dirname, 'src/html', 'advice.html'),
  256. filename: 'advice.html',
  257. chunks: ['advice', 'vendor', 'common'],
  258. hash: true, //防止缓存
  259. inject: true,
  260. minify: {
  261. removeAttributeQuotes: true, //压缩 去掉引号
  262. removeComments: true, //移除HTML中的注释
  263. collapseWhitespace: true //删除空白符与换行符
  264. }
  265. }),
  266. new HtmlWebpackPlugin({
  267. title: 'tiaomuControl.html',
  268. template: path.resolve(__dirname, 'src/html', 'tiaomuControl.html'),
  269. filename: 'tiaomuControl.html',
  270. chunks: ['tiaomuControl', 'vendor', 'common'],
  271. hash: true, //防止缓存
  272. inject: true,
  273. minify: {
  274. removeAttributeQuotes: true, //压缩 去掉引号
  275. removeComments: true, //移除HTML中的注释
  276. collapseWhitespace: true //删除空白符与换行符
  277. }
  278. }),
  279. new HtmlWebpackPlugin({
  280. title: 'checkControl.html',
  281. template: path.resolve(__dirname, 'src/html', 'checkControl.html'),
  282. filename: 'checkControl.html',
  283. chunks: ['checkControl', 'vendor', 'common'],
  284. hash: true, //防止缓存
  285. inject: true,
  286. minify: {
  287. removeAttributeQuotes: true, //压缩 去掉引号
  288. removeComments: true, //移除HTML中的注释
  289. collapseWhitespace: true //删除空白符与换行符
  290. }
  291. }),
  292. new HtmlWebpackPlugin({
  293. title: 'assertTypeDetail.html',
  294. template: path.resolve(__dirname, 'src/html', 'assertTypeDetail.html'),
  295. filename: 'assertTypeDetail.html',
  296. chunks: ['assertTypeDetail', 'vendor', 'common'],
  297. hash: true, //防止缓存
  298. inject: true,
  299. minify: {
  300. removeAttributeQuotes: true, //压缩 去掉引号
  301. removeComments: true, //移除HTML中的注释
  302. collapseWhitespace: true //删除空白符与换行符
  303. }
  304. }),
  305. new HtmlWebpackPlugin({
  306. title: 'assertType.html',
  307. template: path.resolve(__dirname, 'src/html', 'assertType.html'),
  308. filename: 'assertType.html',
  309. chunks: ['assertType', 'vendor', 'common'],
  310. hash: true, //防止缓存
  311. inject: true,
  312. minify: {
  313. removeAttributeQuotes: true, //压缩 去掉引号
  314. removeComments: true, //移除HTML中的注释
  315. collapseWhitespace: true //删除空白符与换行符
  316. }
  317. }),
  318. new HtmlWebpackPlugin({
  319. title: 'mukuaiControl.html',
  320. template: path.resolve(__dirname, 'src/html', 'mukuaiControl.html'),
  321. filename: 'mukuaiControl.html',
  322. chunks: ['mukuaiControl', 'vendor', 'common'],
  323. hash: true, //防止缓存
  324. inject: true,
  325. minify: {
  326. removeAttributeQuotes: true, //压缩 去掉引号
  327. removeComments: true, //移除HTML中的注释
  328. collapseWhitespace: true //删除空白符与换行符
  329. }
  330. }),
  331. new HtmlWebpackPlugin({
  332. title: 'quexianDetail.html',
  333. template: path.resolve(__dirname, 'src/html', 'quexianDetail.html'),
  334. filename: 'quexianDetail.html',
  335. chunks: ['quexianDetail', 'vendor', 'common'],
  336. hash: true, //防止缓存
  337. inject: true,
  338. minify: {
  339. removeAttributeQuotes: true, //压缩 去掉引号
  340. removeComments: true, //移除HTML中的注释
  341. collapseWhitespace: true //删除空白符与换行符
  342. }
  343. }),
  344. new HtmlWebpackPlugin({
  345. title: 'quexianDetailHome.html',
  346. template: path.resolve(__dirname, 'src/html', 'quexianDetailHome.html'),
  347. filename: 'quexianDetailHome.html',
  348. chunks: ['quexianDetailHome', 'vendor', 'common'],
  349. hash: true, //防止缓存
  350. inject: true,
  351. minify: {
  352. removeAttributeQuotes: true, //压缩 去掉引号
  353. removeComments: true, //移除HTML中的注释
  354. collapseWhitespace: true //删除空白符与换行符
  355. }
  356. }),
  357. new HtmlWebpackPlugin({
  358. title: 'quexianDetailControl.html',
  359. template: path.resolve(__dirname, 'src/html', 'quexianDetailControl.html'),
  360. filename: 'quexianDetailControl.html',
  361. chunks: ['quexianDetailControl', 'vendor', 'common'],
  362. hash: true, //防止缓存
  363. inject: true,
  364. minify: {
  365. removeAttributeQuotes: true, //压缩 去掉引号
  366. removeComments: true, //移除HTML中的注释
  367. collapseWhitespace: true //删除空白符与换行符
  368. }
  369. }),
  370. new HtmlWebpackPlugin({
  371. title: 'quexianDetailControlHome.html',
  372. template: path.resolve(__dirname, 'src/html', 'quexianDetailControlHome.html'),
  373. filename: 'quexianDetailControlHome.html',
  374. chunks: ['quexianDetailControlHome', 'vendor', 'common'],
  375. hash: true, //防止缓存
  376. inject: true,
  377. minify: {
  378. removeAttributeQuotes: true, //压缩 去掉引号
  379. removeComments: true, //移除HTML中的注释
  380. collapseWhitespace: true //删除空白符与换行符
  381. }
  382. }),
  383. new HtmlWebpackPlugin({
  384. title: 'quexianXQ.html',
  385. template: path.resolve(__dirname, 'src/html', 'quexianXQ.html'),
  386. filename: 'quexianXQ.html',
  387. chunks: ['quexianXQ', 'vendor', 'common'],
  388. hash: true, //防止缓存
  389. inject: true,
  390. minify: {
  391. removeAttributeQuotes: true, //压缩 去掉引号
  392. removeComments: true, //移除HTML中的注释
  393. collapseWhitespace: true //删除空白符与换行符
  394. }
  395. }),
  396. new HtmlWebpackPlugin({
  397. title: 'partDetailControl.html',
  398. template: path.resolve(__dirname, 'src/html', 'partDetailControl.html'),
  399. filename: 'partDetailControl.html',
  400. chunks: ['partDetailControl', 'vendor', 'common'],
  401. hash: true, //防止缓存
  402. inject: true,
  403. minify: {
  404. removeAttributeQuotes: true, //压缩 去掉引号
  405. removeComments: true, //移除HTML中的注释
  406. collapseWhitespace: true //删除空白符与换行符
  407. }
  408. }),
  409. new HtmlWebpackPlugin({
  410. title: 'jiaji.html',
  411. template: path.resolve(__dirname, 'src/html', 'jiaji.html'),
  412. filename: 'jiaji.html',
  413. chunks: ['jiaji', 'vendor', 'common'],
  414. hash: true, //防止缓存
  415. inject: true,
  416. minify: {
  417. removeAttributeQuotes: true, //压缩 去掉引号
  418. removeComments: true, //移除HTML中的注释
  419. collapseWhitespace: true //删除空白符与换行符
  420. }
  421. }),
  422. new HtmlWebpackPlugin({
  423. title: 'abnormal.html',
  424. template: path.resolve(__dirname, 'src/html', 'abnormal.html'),
  425. filename: 'abnormal.html',
  426. chunks: ['abnormal', 'vendor', 'common'],
  427. hash: true, //防止缓存
  428. inject: true,
  429. minify: {
  430. removeAttributeQuotes: true, //压缩 去掉引号
  431. removeComments: true, //移除HTML中的注释
  432. collapseWhitespace: true //删除空白符与换行符
  433. }
  434. }),
  435. new HtmlWebpackPlugin({
  436. title: 'deptScoreDetailControl.html',
  437. template: path.resolve(__dirname, 'src/html', 'deptScoreDetailControl.html'),
  438. filename: 'deptScoreDetailControl.html',
  439. chunks: ['deptScoreDetailControl', 'vendor', 'common'],
  440. hash: true, //防止缓存
  441. inject: true,
  442. minify: {
  443. removeAttributeQuotes: true, //压缩 去掉引号
  444. removeComments: true, //移除HTML中的注释
  445. collapseWhitespace: true //删除空白符与换行符
  446. }
  447. }),
  448. new HtmlWebpackPlugin({
  449. title: 'payDetail.html',
  450. template: path.resolve(__dirname, 'src/html', 'payDetail.html'),
  451. filename: 'payDetail.html',
  452. chunks: ['payDetail', 'vendor', 'common'],
  453. hash: true, //防止缓存
  454. inject: true,
  455. minify: {
  456. removeAttributeQuotes: true, //压缩 去掉引号
  457. removeComments: true, //移除HTML中的注释
  458. collapseWhitespace: true //删除空白符与换行符
  459. }
  460. }),
  461. new HtmlWebpackPlugin({
  462. title: 'partDetail.html',
  463. template: path.resolve(__dirname, 'src/html', 'partDetail.html'),
  464. filename: 'partDetail.html',
  465. chunks: ['partDetail', 'vendor', 'common'],
  466. hash: true, //防止缓存
  467. inject: true,
  468. minify: {
  469. removeAttributeQuotes: true, //压缩 去掉引号
  470. removeComments: true, //移除HTML中的注释
  471. collapseWhitespace: true //删除空白符与换行符
  472. }
  473. }),
  474. new HtmlWebpackPlugin({
  475. title: 'dayDetail.html',
  476. template: path.resolve(__dirname, 'src/html', 'dayDetail.html'),
  477. filename: 'dayDetail.html',
  478. chunks: ['dayDetail', 'vendor', 'common'],
  479. hash: true, //防止缓存
  480. inject: true,
  481. minify: {
  482. removeAttributeQuotes: true, //压缩 去掉引号
  483. removeComments: true, //移除HTML中的注释
  484. collapseWhitespace: true //删除空白符与换行符
  485. }
  486. }),
  487. new HtmlWebpackPlugin({
  488. title: 'deptScoreDetail.html',
  489. template: path.resolve(__dirname, 'src/html', 'deptScoreDetail.html'),
  490. filename: 'deptScoreDetail.html',
  491. chunks: ['deptScoreDetail', 'vendor', 'common'],
  492. hash: true, //防止缓存
  493. inject: true,
  494. minify: {
  495. removeAttributeQuotes: true, //压缩 去掉引号
  496. removeComments: true, //移除HTML中的注释
  497. collapseWhitespace: true //删除空白符与换行符
  498. }
  499. }),
  500. new HtmlWebpackPlugin({
  501. title: 'deptConsole.html',
  502. template: path.resolve(__dirname, 'src/html', 'deptConsole.html'),
  503. filename: 'deptConsole.html',
  504. chunks: ['deptConsole', 'vendor', 'common'],
  505. hash: true, //防止缓存
  506. inject: true,
  507. minify: {
  508. removeAttributeQuotes: true, //压缩 去掉引号
  509. removeComments: true, //移除HTML中的注释
  510. collapseWhitespace: true //删除空白符与换行符
  511. }
  512. }),
  513. new HtmlWebpackPlugin({
  514. title: 'itemManager.html',
  515. template: path.resolve(__dirname, 'src/html', 'itemManager.html'),
  516. filename: 'itemManager.html',
  517. chunks: ['itemManager', 'vendor', 'common'],
  518. hash: true, //防止缓存
  519. inject: true,
  520. minify: {
  521. removeAttributeQuotes: true, //压缩 去掉引号
  522. removeComments: true, //移除HTML中的注释
  523. collapseWhitespace: true //删除空白符与换行符
  524. }
  525. }),
  526. new HtmlWebpackPlugin({
  527. title: 'moduleManager.html',
  528. template: path.resolve(__dirname, 'src/html', 'moduleManager.html'),
  529. filename: 'moduleManager.html',
  530. chunks: ['moduleManager', 'vendor', 'common'],
  531. hash: true, //防止缓存
  532. inject: true,
  533. minify: {
  534. removeAttributeQuotes: true, //压缩 去掉引号
  535. removeComments: true, //移除HTML中的注释
  536. collapseWhitespace: true //删除空白符与换行符
  537. }
  538. }),
  539. new HtmlWebpackPlugin({
  540. title: 'tiaomu.html',
  541. template: path.resolve(__dirname, 'src/html', 'tiaomu.html'),
  542. filename: 'tiaomu.html',
  543. chunks: ['tiaomu', 'vendor', 'common'],
  544. hash: true, //防止缓存
  545. inject: true,
  546. minify: {
  547. removeAttributeQuotes: true, //压缩 去掉引号
  548. removeComments: true, //移除HTML中的注释
  549. collapseWhitespace: true //删除空白符与换行符
  550. }
  551. }),
  552. new HtmlWebpackPlugin({
  553. title: 'mukuai.html',
  554. template: path.resolve(__dirname, 'src/html', 'mukuai.html'),
  555. filename: 'mukuai.html',
  556. chunks: ['mukuai', 'vendor', 'common'],
  557. hash: true, //防止缓存
  558. inject: true,
  559. minify: {
  560. removeAttributeQuotes: true, //压缩 去掉引号
  561. removeComments: true, //移除HTML中的注释
  562. collapseWhitespace: true //删除空白符与换行符
  563. }
  564. }),
  565. new HtmlWebpackPlugin({
  566. title: 'login.html',
  567. template: path.resolve(__dirname, 'src/html', 'login.html'),
  568. filename: 'login.html',
  569. chunks: ['login', 'vendor', 'common'],
  570. hash: true, //防止缓存
  571. inject: true,
  572. minify: {
  573. removeAttributeQuotes: true, //压缩 去掉引号
  574. removeComments: true, //移除HTML中的注释
  575. collapseWhitespace: true //删除空白符与换行符
  576. }
  577. }),
  578. new HtmlWebpackPlugin({
  579. title: 'qcList.html',
  580. template: path.resolve(__dirname, 'src/html', 'qcList.html'),
  581. filename: 'qcList.html',
  582. chunks: ['qcList', 'vendor', 'common'],
  583. hash: true, //防止缓存
  584. inject: true,
  585. minify: {
  586. removeAttributeQuotes: true, //压缩 去掉引号
  587. removeComments: true, //移除HTML中的注释
  588. collapseWhitespace: true //删除空白符与换行符
  589. }
  590. }),
  591. new HtmlWebpackPlugin({
  592. title: 'qcListCopy.html',
  593. template: path.resolve(__dirname, 'src/html', 'qcListCopy.html'),
  594. filename: 'qcListCopy.html',
  595. chunks: ['qcListCopy', 'vendor', 'common'],
  596. hash: true, //防止缓存
  597. inject: true,
  598. minify: {
  599. removeAttributeQuotes: true, //压缩 去掉引号
  600. removeComments: true, //移除HTML中的注释
  601. collapseWhitespace: true //删除空白符与换行符
  602. }
  603. }),
  604. new HtmlWebpackPlugin({
  605. title: 'qcListCopyUnqualified.html',
  606. template: path.resolve(__dirname, 'src/html', 'qcListCopyUnqualified.html'),
  607. filename: 'qcListCopyUnqualified.html',
  608. chunks: ['qcListCopyUnqualified', 'vendor', 'common'],
  609. hash: true, //防止缓存
  610. inject: true,
  611. minify: {
  612. removeAttributeQuotes: true, //压缩 去掉引号
  613. removeComments: true, //移除HTML中的注释
  614. collapseWhitespace: true //删除空白符与换行符
  615. }
  616. }),
  617. new HtmlWebpackPlugin({
  618. title: 'qcListOutHospital.html',
  619. template: path.resolve(__dirname, 'src/html', 'qcListOutHospital.html'),
  620. filename: 'qcListOutHospital.html',
  621. chunks: ['qcListOutHospital', 'vendor', 'common'],
  622. hash: true, //防止缓存
  623. inject: true,
  624. minify: {
  625. removeAttributeQuotes: true, //压缩 去掉引号
  626. removeComments: true, //移除HTML中的注释
  627. collapseWhitespace: true //删除空白符与换行符
  628. }
  629. }),
  630. new HtmlWebpackPlugin({
  631. title: 'qcListDocteam.html',
  632. template: path.resolve(__dirname, 'src/html', 'qcListDocteam.html'),
  633. filename: 'qcListDocteam.html',
  634. chunks: ['qcListDocteam', 'vendor', 'common'],
  635. hash: true, //防止缓存
  636. inject: true,
  637. minify: {
  638. removeAttributeQuotes: true, //压缩 去掉引号
  639. removeComments: true, //移除HTML中的注释
  640. collapseWhitespace: true //删除空白符与换行符
  641. }
  642. }),
  643. new HtmlWebpackPlugin({
  644. title: 'qcListPerson.html',
  645. template: path.resolve(__dirname, 'src/html', 'qcListPerson.html'),
  646. filename: 'qcListPerson.html',
  647. chunks: ['qcListPerson', 'vendor', 'common'],
  648. hash: true, //防止缓存
  649. inject: true,
  650. minify: {
  651. removeAttributeQuotes: true, //压缩 去掉引号
  652. removeComments: true, //移除HTML中的注释
  653. collapseWhitespace: true //删除空白符与换行符
  654. }
  655. }),
  656. new HtmlWebpackPlugin({
  657. title: 'qcListDept.html',
  658. template: path.resolve(__dirname, 'src/html', 'qcListDept.html'),
  659. filename: 'qcListDept.html',
  660. chunks: ['qcListDept', 'vendor', 'common'],
  661. hash: true, //防止缓存
  662. inject: true,
  663. minify: {
  664. removeAttributeQuotes: true, //压缩 去掉引号
  665. removeComments: true, //移除HTML中的注释
  666. collapseWhitespace: true //删除空白符与换行符
  667. }
  668. }),
  669. new HtmlWebpackPlugin({
  670. title: 'qcScore.html',
  671. template: path.resolve(__dirname, 'src/html', 'qcScore.html'),
  672. filename: 'qcScore.html',
  673. chunks: ['qcScore', 'vendor', 'common'],
  674. hash: true, //防止缓存
  675. inject: true,
  676. minify: {
  677. removeAttributeQuotes: true, //压缩 去掉引号
  678. removeComments: true, //移除HTML中的注释
  679. collapseWhitespace: true //删除空白符与换行符
  680. }
  681. }),
  682. new HtmlWebpackPlugin({
  683. title: 'statistics.html',
  684. template: path.resolve(__dirname, 'src/html', 'statistics.html'),
  685. filename: 'statistics.html',
  686. chunks: ['index', 'vendor', 'common'],
  687. hash: true, //防止缓存
  688. inject: true,
  689. minify: {
  690. removeAttributeQuotes: true, //压缩 去掉引号
  691. removeComments: true, //移除HTML中的注释
  692. collapseWhitespace: true //删除空白符与换行符
  693. }
  694. }),
  695. new HtmlWebpackPlugin({
  696. title: 'userManager.html',
  697. template: path.resolve(__dirname, 'src/html', 'userManager.html'),
  698. filename: 'userManager.html',
  699. chunks: ['userManager', 'vendor', 'common'],
  700. hash: true, //防止缓存
  701. inject: true,
  702. minify: {
  703. removeAttributeQuotes: true, //压缩 去掉引号
  704. removeComments: true, //移除HTML中的注释
  705. collapseWhitespace: true //删除空白符与换行符
  706. }
  707. }),
  708. new HtmlWebpackPlugin({
  709. title: 'roleManager.html',
  710. template: path.resolve(__dirname, 'src/html', 'roleManager.html'),
  711. filename: 'roleManager.html',
  712. chunks: ['roleManager', 'vendor', 'common'],
  713. hash: true, //防止缓存
  714. inject: true,
  715. minify: {
  716. removeAttributeQuotes: true, //压缩 去掉引号
  717. removeComments: true, //移除HTML中的注释
  718. collapseWhitespace: true //删除空白符与换行符
  719. }
  720. }),
  721. new HtmlWebpackPlugin({
  722. title: 'singleVeto.html', //单项否决详情页
  723. template: path.resolve(__dirname, 'src/html', 'singleVeto.html'),
  724. filename: 'singleVeto.html',
  725. chunks: ['singleVeto', 'vendor', 'common'],
  726. hash: true, //防止缓存
  727. inject: true,
  728. minify: {
  729. removeAttributeQuotes: true, //压缩 去掉引号
  730. removeComments: true, //移除HTML中的注释
  731. collapseWhitespace: true //删除空白符与换行符
  732. }
  733. }),
  734. new HtmlWebpackPlugin({
  735. title: 'itemDefectDetail.html', //单项否决详情页
  736. template: path.resolve(__dirname, 'src/html', 'itemDefectDetail.html'),
  737. filename: 'itemDefectDetail.html',
  738. chunks: ['itemDefectDetail', 'vendor', 'common'],
  739. hash: true, //防止缓存
  740. inject: true,
  741. minify: {
  742. removeAttributeQuotes: true, //压缩 去掉引号
  743. removeComments: true, //移除HTML中的注释
  744. collapseWhitespace: true //删除空白符与换行符
  745. }
  746. }),
  747. new HtmlWebpackPlugin({
  748. title: 'keyItemFlawControl.html', //关键条目缺陷占比
  749. template: path.resolve(__dirname, 'src/html', 'keyItemFlawControl.html'),
  750. filename: 'keyItemFlawControl.html',
  751. chunks: ['keyItemFlawControl', 'vendor', 'common'],
  752. hash: true, //防止缓存
  753. inject: true,
  754. minify: {
  755. removeAttributeQuotes: true, //压缩 去掉引号
  756. removeComments: true, //移除HTML中的注释
  757. collapseWhitespace: true //删除空白符与换行符
  758. }
  759. }),
  760. new HtmlWebpackPlugin({
  761. title: 'qualifiedPhysician.html', //合格率医生
  762. template: path.resolve(__dirname, 'src/html', 'qualifiedPhysician.html'),
  763. filename: 'qualifiedPhysician.html',
  764. chunks: ['qualifiedPhysician', 'vendor', 'common'],
  765. hash: true, //防止缓存
  766. inject: true,
  767. minify: {
  768. removeAttributeQuotes: true, //压缩 去掉引号
  769. removeComments: true, //移除HTML中的注释
  770. collapseWhitespace: true //删除空白符与换行符
  771. }
  772. }),
  773. new HtmlWebpackPlugin({
  774. title: 'deptQualifiedPhysician.html', //合格率医生
  775. template: path.resolve(__dirname, 'src/html', 'deptQualifiedPhysician.html'),
  776. filename: 'deptQualifiedPhysician.html',
  777. chunks: ['deptQualifiedPhysician', 'vendor', 'common'],
  778. hash: true, //防止缓存
  779. inject: true,
  780. minify: {
  781. removeAttributeQuotes: true, //压缩 去掉引号
  782. removeComments: true, //移除HTML中的注释
  783. collapseWhitespace: true //删除空白符与换行符
  784. }
  785. }),
  786. new HtmlWebpackPlugin({
  787. title: 'uncorrectedCasesStatistics.html', //未整改病历统计
  788. template: path.resolve(__dirname, 'src/html', 'uncorrectedCasesStatistics.html'),
  789. filename: 'uncorrectedCasesStatistics.html',
  790. chunks: ['uncorrectedCasesStatistics', 'vendor', 'common'],
  791. hash: true, //防止缓存
  792. inject: true,
  793. minify: {
  794. removeAttributeQuotes: true, //压缩 去掉引号
  795. removeComments: true, //移除HTML中的注释
  796. collapseWhitespace: true //删除空白符与换行符
  797. }
  798. }),
  799. new HtmlWebpackPlugin({
  800. title: 'uccDetail.html', //未整改病历统计_缺陷详情
  801. template: path.resolve(__dirname, 'src/html', 'uccDetail.html'),
  802. filename: 'uccDetail.html',
  803. chunks: ['uccDetail', 'vendor', 'common'],
  804. hash: true, //防止缓存
  805. inject: true,
  806. minify: {
  807. removeAttributeQuotes: true, //压缩 去掉引号
  808. removeComments: true, //移除HTML中的注释
  809. collapseWhitespace: true //删除空白符与换行符
  810. }
  811. }),
  812. new HtmlWebpackPlugin({
  813. title: 'readmission.html', //未整改病历统计_缺陷详情
  814. template: path.resolve(__dirname, 'src/html', 'readmission.html'),
  815. filename: 'readmission.html',
  816. chunks: ['readmission', 'vendor', 'common'],
  817. hash: true, //防止缓存
  818. inject: true,
  819. minify: {
  820. removeAttributeQuotes: true, //压缩 去掉引号
  821. removeComments: true, //移除HTML中的注释
  822. collapseWhitespace: true //删除空白符与换行符
  823. }
  824. }),
  825. new CopyWebpackPlugin([
  826. {
  827. from: 'src/resource',
  828. to: path.resolve(__dirname, 'dist', 'resource'),
  829. flatten: true, //false会拷贝原始文件夹路径
  830. }
  831. ]),
  832. new MiniCssExtractPlugin({
  833. filename: 'css/[name].css',
  834. chunkFilename: '[id].css'
  835. }),
  836. new webpack.HotModuleReplacementPlugin(),
  837. new CleanWebpackPlugin()
  838. ],
  839. optimization: { //webpack4.x的最新优化配置项,用于提取公共代码
  840. minimizer: [
  841. new UglifyJsPlugin({
  842. uglifyOptions: {
  843. ie8: true,
  844. compress: {
  845. properties: false,
  846. warnings: false
  847. },
  848. mangle: {
  849. screw_ie8: false,
  850. except: ['e']
  851. },
  852. output: {
  853. beautify: true
  854. },
  855. sourceMap: false
  856. }
  857. })
  858. ],
  859. splitChunks: {
  860. cacheGroups: {
  861. commons: {
  862. chunks: "initial",
  863. name: "common",
  864. minChunks: 2,
  865. maxInitialRequests: 5, // The default limit is too small to showcase the effect
  866. minSize: 0, // This is example is too small to create commons chunks
  867. reuseExistingChunk: true // 可设置是否重用该chunk
  868. }
  869. }
  870. }
  871. },
  872. module: {
  873. noParse: /WdatePicker/,
  874. rules: [
  875. {
  876. test: /.js$/,
  877. enforce: 'post',
  878. loader: 'es3ify-loader'
  879. },
  880. {
  881. test: /\.m?js$/,
  882. exclude: /(node_modules|bower_components)/,
  883. use: {
  884. loader: 'babel-loader',
  885. options: {
  886. presets: ['@babel/preset-env']
  887. }
  888. }
  889. },
  890. {
  891. test: /\.css$/,
  892. use: [{
  893. loader: MiniCssExtractPlugin.loader
  894. },
  895. 'css-loader'
  896. ]
  897. },
  898. {
  899. test: /\.less$/,
  900. use: [{
  901. loader: MiniCssExtractPlugin.loader
  902. },
  903. 'css-loader', 'less-loader'
  904. ]
  905. },
  906. {
  907. test: /\.(png|gif|jpg|jpeg|svg|eot|ttf|woff|woff2)$/,
  908. use: [{
  909. loader: 'url-loader',
  910. options: {
  911. limit: 10240,
  912. esModule: false,
  913. name: '[name]_[hash:6].[ext]',
  914. outputPath: 'images/'
  915. }
  916. }],
  917. exclude: /node_modules/
  918. }, {
  919. test: /.html$/,
  920. use: 'html-withimg-loader'
  921. }
  922. ]
  923. },
  924. // devtool: 'cheap-module-eval-source-map', //开发环境cheap-module-eval-source-map //生产环境cheap-module-source-map
  925. mode: 'development',
  926. devServer: {
  927. contentBase: "./dist", //静态文件根目录
  928. proxy: {
  929. '/': proxyHost
  930. },
  931. hot: true,
  932. openPage: 'login.html'
  933. }
  934. }