123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936 |
- const path = require('path');
- const HtmlWebpackPlugin = require('html-webpack-plugin');
- /*const HtmlWebpackInlineSourcePlugin=require('html-webpack-inline-source-plugin');*/
- const CleanWebpackPlugin = require('clean-webpack-plugin') // 清空打包目录的插件
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
- const CopyWebpackPlugin = require('copy-webpack-plugin');
- const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
- const webpack = require('webpack');
- // const proxyHost = "http://192.168.2.236:5858";
- // const proxyHost = "http://173.18.12.195:5858";
- const proxyHost = "http://192.168.4.222:5858";
- // const proxyHost = "http://192.168.3.117:5858";//铁钢
- // const proxyHost = "http://192.168.3.113:5858";//王峰
- module.exports = {
- entry: {
- index: path.resolve(__dirname, 'src/js', 'index.js'),
- qcScore: path.resolve(__dirname, 'src/js', 'qcScore.js'),
- login: path.resolve(__dirname, 'src/js', 'login.js'),
- console: path.resolve(__dirname, 'src/js', 'console.js'),
- deptConsole: path.resolve(__dirname, 'src/js', 'deptConsole.js'),
- moduleManager: path.resolve(__dirname, 'src/js', 'moduleManager.js'),
- itemManager: path.resolve(__dirname, 'src/js', 'itemManager.js'),
- qcList: path.resolve(__dirname, 'src/js', 'qcList.js'),
- qcListDocteam: path.resolve(__dirname, 'src/js', 'qcListDocteam.js'),
- qcListDept: path.resolve(__dirname, 'src/js', 'qcListDept.js'),
- qcListPerson: path.resolve(__dirname, 'src/js', 'qcListPerson.js'),
- userManager: path.resolve(__dirname, 'src/js', 'userManager.js'),
- roleManager: path.resolve(__dirname, 'src/js', 'roleManager.js'),
- tiaomu: path.resolve(__dirname, 'src/js', 'tiaomu.js'),
- mukuai: path.resolve(__dirname, 'src/js', 'mukuai.js'),
- abnormal: path.resolve(__dirname, 'src/js', 'abnormal.js'),
- partDetail: path.resolve(__dirname, 'src/js', 'partDetail.js'),
- dayDetail: path.resolve(__dirname, 'src/js', 'dayDetail.js'),
- payDetail: path.resolve(__dirname, 'src/js', 'payDetail.js'),
- deptScoreDetail: path.resolve(__dirname, 'src/js', 'deptScoreDetail.js'),
- deptScoreDetailControl: path.resolve(__dirname, 'src/js', 'deptScoreDetailControl.js'),
- jiaji: path.resolve(__dirname, 'src/js', 'jiaji.js'),
- partDetailControl: path.resolve(__dirname, 'src/js', 'partDetailControl.js'),
- quexianXQ: path.resolve(__dirname, 'src/js', 'quexianXQ.js'),
- quexianDetail: path.resolve(__dirname, 'src/js', 'quexianDetail.js'),
- quexianDetailControl: path.resolve(__dirname, 'src/js', 'quexianDetailControl.js'),
- quexianDetailHome: path.resolve(__dirname, 'src/js', 'quexianDetailHome.js'),
- quexianDetailControlHome: path.resolve(__dirname, 'src/js', 'quexianDetailControlHome.js'),
- mukuaiControl: path.resolve(__dirname, 'src/js', 'mukuaiControl.js'),
- tiaomuControl: path.resolve(__dirname, 'src/js', 'tiaomuControl.js'),
- assertType: path.resolve(__dirname, 'src/js', 'assertType.js'),
- assertTypeDetail: path.resolve(__dirname, 'src/js', 'assertTypeDetail.js'),
- singleVeto: path.resolve(__dirname, 'src/js', 'singleVeto.js'),
- itemDefectDetail: path.resolve(__dirname, 'src/js', 'itemDefectDetail.js'),
- keyItemFlawControl: path.resolve(__dirname, 'src/js', 'keyItemFlawControl.js'),
- qualifiedPhysician: path.resolve(__dirname, 'src/js', 'qualifiedPhysician.js'),
- deptQualifiedPhysician: path.resolve(__dirname, 'src/js', 'deptQualifiedPhysician.js'),
- qcListCopy: path.resolve(__dirname, 'src/js', 'qcListCopy.js'),
- qcListCopyUnqualified: path.resolve(__dirname, 'src/js', 'qcListCopyUnqualified.js'),
- qcListOutHospital: path.resolve(__dirname, 'src/js', 'qcListOutHospital.js'),
- checkControl: path.resolve(__dirname, 'src/js', 'checkControl.js'),
- advice: path.resolve(__dirname, 'src/js', 'advice.js'),
- uncorrectedCasesStatistics: path.resolve(__dirname, 'src/js', 'uncorrectedCasesStatistics.js'),
- uncorrectedCopy: path.resolve(__dirname, 'src/js', 'uncorrectedCopy.js'),
- uccDetail: path.resolve(__dirname, 'src/js', 'uccDetail.js'),
- readmission: path.resolve(__dirname, 'src/js', 'readmission.js'),
- pacs: path.resolve(__dirname, 'src/js', 'pacs.js'),
- pacsDetail: path.resolve(__dirname, 'src/js', 'pacsDetail.js'),
- assist: path.resolve(__dirname, 'src/js', 'assist.js'),
- error: path.resolve(__dirname, 'src/js', 'error.js'),
- nursing: path.resolve(__dirname, 'src/js', 'nursing.js'),
- other: path.resolve(__dirname, 'src/js', 'other.js'),
- mentCenter: path.resolve(__dirname, 'src/js', 'mentCenter.js'),
- test: path.resolve(__dirname, 'src/js/dept', 'test.js'),
- partDetailControlDept: path.resolve(__dirname, 'src/js/dept', 'partDetailControlDept.js'),
- messageNoti: path.resolve(__dirname, 'src/js/dept', 'messageNoti.js'),
- vendor: 'lodash', //多个页面所需的公共库文件,防止重复打包带入
- },
- output: {
- publicPath: '/', //这里要放的是静态资源CDN的地址
- path: path.resolve(__dirname, 'dist'),
- filename: 'js/[name].js'
- },
- resolve: {
- extensions: [".js", ".css", ".json"],
- alias: {} //配置别名可以加快webpack查找模块的速度
- },
- plugins: [//多入口的html文件用chunks这个参数来区分
- new HtmlWebpackPlugin({
- title: 'test',
- template: path.resolve(__dirname, 'src/html/dept', 'test.html'),
- filename: 'test.html',
- chunks: ['test', 'vendor', 'common', 'src/resouce/dot.js'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'index',
- template: path.resolve(__dirname, 'src/html', 'index.html'),
- filename: 'index.html',
- chunks: ['index', 'vendor', 'common', 'scrollBar', 'src/resouce/dot.js'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'partDetailControlDept',
- template: path.resolve(__dirname, 'src/html/dept', 'partDetailControlDept.html'),
- filename: 'partDetailControlDept.html',
- chunks: ['partDetailControlDept', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'messageNoti',
- template: path.resolve(__dirname, 'src/html/dept', 'messageNoti.html'),
- filename: 'messageNoti.html',
- chunks: ['messageNoti', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'nursing',
- template: path.resolve(__dirname, 'src/html', 'nursing.html'),
- filename: 'nursing.html',
- chunks: ['nursing', 'vendor', 'common', 'scrollBar'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'other',
- template: path.resolve(__dirname, 'src/html', 'other.html'),
- filename: 'other.html',
- chunks: ['other', 'vendor', 'common', 'scrollBar'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'mentCenter',
- template: path.resolve(__dirname, 'src/html', 'mentCenter.html'),
- filename: 'mentCenter.html',
- chunks: ['mentCenter', 'vendor', 'common', 'scrollBar'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'error',
- template: path.resolve(__dirname, 'src/html', 'error.html'),
- filename: 'error.html',
- chunks: ['error', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'console.html',
- template: path.resolve(__dirname, 'src/html', 'console.html'),
- filename: 'console.html',
- chunks: ['console', 'vendor', 'common', 'scrollBar'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'uncorrectedCopy.html',
- template: path.resolve(__dirname, 'src/html', 'uncorrectedCopy.html'),
- filename: 'uncorrectedCopy.html',
- chunks: ['uncorrectedCopy', 'vendor', 'common', 'scrollBar'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'pacs.html',
- template: path.resolve(__dirname, 'src/html', 'pacs.html'),
- filename: 'pacs.html',
- chunks: ['pacs', 'vendor', 'common', 'scrollBar'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'pacsDetail.html',
- template: path.resolve(__dirname, 'src/html', 'pacsDetail.html'),
- filename: 'pacsDetail.html',
- chunks: ['pacsDetail', 'vendor', 'common', 'scrollBar'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'assist.html',
- template: path.resolve(__dirname, 'src/html', 'assist.html'),
- filename: 'assist.html',
- chunks: ['assist', 'vendor', 'common', 'scrollBar'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'advice.html',
- template: path.resolve(__dirname, 'src/html', 'advice.html'),
- filename: 'advice.html',
- chunks: ['advice', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'tiaomuControl.html',
- template: path.resolve(__dirname, 'src/html', 'tiaomuControl.html'),
- filename: 'tiaomuControl.html',
- chunks: ['tiaomuControl', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'checkControl.html',
- template: path.resolve(__dirname, 'src/html', 'checkControl.html'),
- filename: 'checkControl.html',
- chunks: ['checkControl', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'assertTypeDetail.html',
- template: path.resolve(__dirname, 'src/html', 'assertTypeDetail.html'),
- filename: 'assertTypeDetail.html',
- chunks: ['assertTypeDetail', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'assertType.html',
- template: path.resolve(__dirname, 'src/html', 'assertType.html'),
- filename: 'assertType.html',
- chunks: ['assertType', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'mukuaiControl.html',
- template: path.resolve(__dirname, 'src/html', 'mukuaiControl.html'),
- filename: 'mukuaiControl.html',
- chunks: ['mukuaiControl', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'quexianDetail.html',
- template: path.resolve(__dirname, 'src/html', 'quexianDetail.html'),
- filename: 'quexianDetail.html',
- chunks: ['quexianDetail', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'quexianDetailHome.html',
- template: path.resolve(__dirname, 'src/html', 'quexianDetailHome.html'),
- filename: 'quexianDetailHome.html',
- chunks: ['quexianDetailHome', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'quexianDetailControl.html',
- template: path.resolve(__dirname, 'src/html', 'quexianDetailControl.html'),
- filename: 'quexianDetailControl.html',
- chunks: ['quexianDetailControl', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'quexianDetailControlHome.html',
- template: path.resolve(__dirname, 'src/html', 'quexianDetailControlHome.html'),
- filename: 'quexianDetailControlHome.html',
- chunks: ['quexianDetailControlHome', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'quexianXQ.html',
- template: path.resolve(__dirname, 'src/html', 'quexianXQ.html'),
- filename: 'quexianXQ.html',
- chunks: ['quexianXQ', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'partDetailControl.html',
- template: path.resolve(__dirname, 'src/html', 'partDetailControl.html'),
- filename: 'partDetailControl.html',
- chunks: ['partDetailControl', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'jiaji.html',
- template: path.resolve(__dirname, 'src/html', 'jiaji.html'),
- filename: 'jiaji.html',
- chunks: ['jiaji', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'abnormal.html',
- template: path.resolve(__dirname, 'src/html', 'abnormal.html'),
- filename: 'abnormal.html',
- chunks: ['abnormal', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'deptScoreDetailControl.html',
- template: path.resolve(__dirname, 'src/html', 'deptScoreDetailControl.html'),
- filename: 'deptScoreDetailControl.html',
- chunks: ['deptScoreDetailControl', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'payDetail.html',
- template: path.resolve(__dirname, 'src/html', 'payDetail.html'),
- filename: 'payDetail.html',
- chunks: ['payDetail', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'partDetail.html',
- template: path.resolve(__dirname, 'src/html', 'partDetail.html'),
- filename: 'partDetail.html',
- chunks: ['partDetail', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'dayDetail.html',
- template: path.resolve(__dirname, 'src/html', 'dayDetail.html'),
- filename: 'dayDetail.html',
- chunks: ['dayDetail', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'deptScoreDetail.html',
- template: path.resolve(__dirname, 'src/html', 'deptScoreDetail.html'),
- filename: 'deptScoreDetail.html',
- chunks: ['deptScoreDetail', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'deptConsole.html',
- template: path.resolve(__dirname, 'src/html', 'deptConsole.html'),
- filename: 'deptConsole.html',
- chunks: ['deptConsole', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'itemManager.html',
- template: path.resolve(__dirname, 'src/html', 'itemManager.html'),
- filename: 'itemManager.html',
- chunks: ['itemManager', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'moduleManager.html',
- template: path.resolve(__dirname, 'src/html', 'moduleManager.html'),
- filename: 'moduleManager.html',
- chunks: ['moduleManager', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'tiaomu.html',
- template: path.resolve(__dirname, 'src/html', 'tiaomu.html'),
- filename: 'tiaomu.html',
- chunks: ['tiaomu', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'mukuai.html',
- template: path.resolve(__dirname, 'src/html', 'mukuai.html'),
- filename: 'mukuai.html',
- chunks: ['mukuai', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'login.html',
- template: path.resolve(__dirname, 'src/html', 'login.html'),
- filename: 'login.html',
- chunks: ['login', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'qcList.html',
- template: path.resolve(__dirname, 'src/html', 'qcList.html'),
- filename: 'qcList.html',
- chunks: ['qcList', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'qcListCopy.html',
- template: path.resolve(__dirname, 'src/html', 'qcListCopy.html'),
- filename: 'qcListCopy.html',
- chunks: ['qcListCopy', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'qcListCopyUnqualified.html',
- template: path.resolve(__dirname, 'src/html', 'qcListCopyUnqualified.html'),
- filename: 'qcListCopyUnqualified.html',
- chunks: ['qcListCopyUnqualified', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'qcListOutHospital.html',
- template: path.resolve(__dirname, 'src/html', 'qcListOutHospital.html'),
- filename: 'qcListOutHospital.html',
- chunks: ['qcListOutHospital', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'qcListDocteam.html',
- template: path.resolve(__dirname, 'src/html', 'qcListDocteam.html'),
- filename: 'qcListDocteam.html',
- chunks: ['qcListDocteam', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'qcListPerson.html',
- template: path.resolve(__dirname, 'src/html', 'qcListPerson.html'),
- filename: 'qcListPerson.html',
- chunks: ['qcListPerson', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'qcListDept.html',
- template: path.resolve(__dirname, 'src/html', 'qcListDept.html'),
- filename: 'qcListDept.html',
- chunks: ['qcListDept', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'qcScore.html',
- template: path.resolve(__dirname, 'src/html', 'qcScore.html'),
- filename: 'qcScore.html',
- chunks: ['qcScore', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'statistics.html',
- template: path.resolve(__dirname, 'src/html', 'statistics.html'),
- filename: 'statistics.html',
- chunks: ['index', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'userManager.html',
- template: path.resolve(__dirname, 'src/html', 'userManager.html'),
- filename: 'userManager.html',
- chunks: ['userManager', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'roleManager.html',
- template: path.resolve(__dirname, 'src/html', 'roleManager.html'),
- filename: 'roleManager.html',
- chunks: ['roleManager', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'singleVeto.html', //单项否决详情页
- template: path.resolve(__dirname, 'src/html', 'singleVeto.html'),
- filename: 'singleVeto.html',
- chunks: ['singleVeto', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'itemDefectDetail.html', //单项否决详情页
- template: path.resolve(__dirname, 'src/html', 'itemDefectDetail.html'),
- filename: 'itemDefectDetail.html',
- chunks: ['itemDefectDetail', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'keyItemFlawControl.html', //关键条目缺陷占比
- template: path.resolve(__dirname, 'src/html', 'keyItemFlawControl.html'),
- filename: 'keyItemFlawControl.html',
- chunks: ['keyItemFlawControl', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'qualifiedPhysician.html', //合格率医生
- template: path.resolve(__dirname, 'src/html', 'qualifiedPhysician.html'),
- filename: 'qualifiedPhysician.html',
- chunks: ['qualifiedPhysician', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'deptQualifiedPhysician.html', //合格率医生
- template: path.resolve(__dirname, 'src/html', 'deptQualifiedPhysician.html'),
- filename: 'deptQualifiedPhysician.html',
- chunks: ['deptQualifiedPhysician', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'uncorrectedCasesStatistics.html', //未整改病历统计
- template: path.resolve(__dirname, 'src/html', 'uncorrectedCasesStatistics.html'),
- filename: 'uncorrectedCasesStatistics.html',
- chunks: ['uncorrectedCasesStatistics', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'uccDetail.html', //未整改病历统计_缺陷详情
- template: path.resolve(__dirname, 'src/html', 'uccDetail.html'),
- filename: 'uccDetail.html',
- chunks: ['uccDetail', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new HtmlWebpackPlugin({
- title: 'readmission.html', //未整改病历统计_缺陷详情
- template: path.resolve(__dirname, 'src/html', 'readmission.html'),
- filename: 'readmission.html',
- chunks: ['readmission', 'vendor', 'common'],
- hash: true, //防止缓存
- inject: true,
- minify: {
- removeAttributeQuotes: true, //压缩 去掉引号
- removeComments: true, //移除HTML中的注释
- collapseWhitespace: true //删除空白符与换行符
- }
- }),
- new CopyWebpackPlugin([
- {
- from: 'src/resource',
- to: path.resolve(__dirname, 'dist', 'resource'),
- flatten: true, //false会拷贝原始文件夹路径
- }
- ]),
- new MiniCssExtractPlugin({
- filename: 'css/[name].css',
- chunkFilename: '[id].css'
- }),
- new webpack.HotModuleReplacementPlugin(),
- new CleanWebpackPlugin()
- ],
- optimization: { //webpack4.x的最新优化配置项,用于提取公共代码
- minimizer: [
- new UglifyJsPlugin({
- uglifyOptions: {
- ie8: true,
- compress: {
- properties: false,
- warnings: false
- },
- mangle: {
- screw_ie8: false,
- except: ['e']
- },
- output: {
- beautify: true
- },
- sourceMap: false
- }
- })
- ],
- splitChunks: {
- cacheGroups: {
- commons: {
- chunks: "initial",
- name: "common",
- minChunks: 2,
- maxInitialRequests: 5, // The default limit is too small to showcase the effect
- minSize: 0, // This is example is too small to create commons chunks
- reuseExistingChunk: true // 可设置是否重用该chunk
- }
- }
- }
- },
- module: {
- noParse: /WdatePicker/,
- rules: [
- {
- test: /.js$/,
- enforce: 'post',
- loader: 'es3ify-loader'
- },
- {
- test: /\.m?js$/,
- exclude: /(node_modules|bower_components)/,
- use: {
- loader: 'babel-loader',
- options: {
- presets: ['@babel/preset-env']
- }
- }
- },
- {
- test: /\.css$/,
- use: [{
- loader: MiniCssExtractPlugin.loader
- },
- 'css-loader'
- ]
- },
- {
- test: /\.less$/,
- use: [{
- loader: MiniCssExtractPlugin.loader
- },
- 'css-loader', 'less-loader'
- ]
- },
- {
- test: /\.(png|gif|jpg|jpeg|svg|eot|ttf|woff|woff2)$/,
- use: [{
- loader: 'url-loader',
- options: {
- limit: 10240,
- esModule: false,
- name: '[name]_[hash:6].[ext]',
- outputPath: 'images/'
- }
- }],
- exclude: /node_modules/
- }, {
- test: /.html$/,
- use: 'html-withimg-loader'
- }
- ]
- },
- // devtool: 'cheap-module-eval-source-map', //开发环境cheap-module-eval-source-map //生产环境cheap-module-source-map
- mode: 'development',
- devServer: {
- contentBase: "./dist", //静态文件根目录
- proxy: {
- '/': proxyHost
- },
- hot: true,
- openPage: 'login.html'
- }
- }
|