<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      build 文件夾中的 webpack.dev.conf.js

       

        1 //此文件是開發環境下webpack相關配置
        2 'use strict'
        3 const utils = require('./utils')
        4 const webpack = require('webpack')
        5 const config = require('../config')
        6 const merge = require('webpack-merge') //導入webpackage-merge 用來合并對象 去掉重復的屬性
        7 const path = require('path')
        8 const baseWebpackConfig = require('./webpack.base.conf')
        9 const CopyWebpackPlugin = require('copy-webpack-plugin') //導入copy-webpack-plugin 用來復制
       10 const HtmlWebpackPlugin = require('html-webpack-plugin') //導入html-webpack-plugin 用來自動生成html
       11 const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') //導入friendily-errors-webpack-plugin 用來收集和展示錯誤日志
       12 const portfinder = require('portfinder') //導入portfinder 用來獲取port
       13 
       14 // 主機
       15 const HOST = process.env.HOST
       16 
       17 // 端口
       18 const PORT = process.env.PORT && Number(process.env.PORT)
       19 
       20 // 合并
       21 const devWebpackConfig = merge(baseWebpackConfig, {
       22   mode: 'development',
       23   module: {
       24 
       25     //解析樣式文件的規則 
       26     rules: utils.styleLoaders({
       27       sourceMap: config.dev.cssSourceMap,
       28       usePostCSS: true
       29     })
       30   },
       31 
       32   // cheap-module-eval-source-map is faster for development
       33   // 開發工具 用來調試
       34   devtool: config.dev.devtool,
       35 
       36 
       37   // 服務器 如需要請求本地數據時  需要在此塊添加其他配置
       38   // 這些 devServer 選項應該在 /config/index.js 中定制
       39   devServer: {
       40 
       41     //重新加載server,控制臺以warning方式提示錯誤
       42     clientLogLevel: 'warning',
       43 
       44 
       45     //HTML5 history api時,任意的404可能需要被替代為index.html
       46     historyApiFallback: {
       47       rewrites: [{
       48         from: /.*/,
       49         to: path.posix.join(config.dev.assetsPublicPath, 'index.html')
       50       }, ],
       51     },
       52     hot: true, //啟用熱替換
       53 
       54     contentBase: false, // 告訴服務器從哪里提供內容,只有在你想要提供靜態文件時才需要,這里是禁用 ( since we use CopyWebpackPlugin. )
       55 
       56     compress: true, //是否壓縮
       57     host: HOST || config.dev.host, //主機
       58     port: PORT || config.dev.port, //端口
       59     open: config.dev.autoOpenBrowser, //是否自動打開瀏覽器
       60 
       61     // 編譯出錯時是否有提示
       62     overlay: config.dev.errorOverlay ? {
       63       warnings: false,
       64       errors: true
       65     } : false,
       66 
       67     publicPath: config.dev.assetsPublicPath, //靜態資源路徑 此路徑可在瀏覽器中打開
       68     proxy: config.dev.proxyTable, //代理
       69     quiet: true, // 啟用quiet 意思是除了啟動信息以外的任何信息都不會打印在控制臺 (necessary for FriendlyErrorsPlugin)
       70 
       71     // 監視文件的選項
       72     watchOptions: {
       73       poll: config.dev.poll,
       74     }
       75   },
       76   plugins: [
       77     // 自定義一個plugin 生成當前環境的一個變量
       78     new webpack.DefinePlugin({
       79       'process.env': require('../config/dev.env')
       80     }),
       81     new webpack.HotModuleReplacementPlugin(), //模塊熱替換插件 修改模塊時不需要刷新頁面
       82 
       83     // https://github.com/ampedandwired/html-webpack-plugin
       84     // 這是一個webpack插件,可以簡化HTML文件的創建,從而為您的webpack bundle提供服務。這對于webpack bundle特別有用,因為它在文件名中包含一個哈希值,這會改變每次編譯。你可以讓插件為你生成一個HTML文件,使用lodash模板提供你自己的模板,或者使用你自己的加載器。
       85     new HtmlWebpackPlugin({
       86       filename: 'index.html',
       87       template: 'index.html',
       88       favicon: path.resolve(__dirname, '../static/images/favicon.ico'),
       89       inject: true,
       90       dll: (function () {
       91         let max = 2
       92         let res = []
       93         for (let i = 0; i < max; i++) {
       94           const dllName = require(path.resolve(__dirname, `../dllManifest/xuAdmin${i}-manifest.json`)).name.split('_')
       95           res.push(`/static/dll/${dllName[0]}.${dllName[1]}.dll.js`)
       96         }
       97         return res
       98       })()
       99     }),
      100     // 復制靜態資源到開發環境的路徑
      101     new CopyWebpackPlugin([{
      102       from: path.resolve(__dirname, '../static'),
      103       to: config.dev.assetsSubDirectory,
      104       ignore: ['.*']
      105     }])
      106   ]
      107 })
      108 
      109 // 導出
      110 module.exports = new Promise((resolve, reject) => {
      111   // 獲取basePort
      112   portfinder.basePort = process.env.PORT || config.dev.port
      113   // 端口配置
      114   portfinder.getPort((err, port) => {
      115     if (err) {
      116       reject(err)
      117     } else {
      118       process.env.PORT = port // 發布 e2e 測試所需的新端口
      119       devWebpackConfig.devServer.port = port // 添加端口到 devServer 配置
      120 
      121       // 添加友好提示(Add FriendlyErrorsPlugin)
      122       devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
      123         // 編譯成功提示
      124         compilationSuccessInfo: {
      125           // 提示運行的組機和端口
      126           messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
      127           // 備注
      128           notes: [`   _     _       _     _       _     _        _     _      _     _     
      129                      (c).-.(c)     (c).-.(c)     (c).-.(c)     (c).-.(c)     (c).-.(c)    
      130                       / ._. \\      / ._. \\      / ._. \\      / ._. \\      / ._. \\   
      131                    __\\( Z )/__  __\\( Y )/__  __\\( J )/__  __\\( B )/__  __\\( X )/__  
      132                    (_.-/'-'\\-._)(_.-/'-'\\-._)(_.-/'-'\\-._)(_.-/'-'\\-._)(_.-/'-'\\-._)
      133                      || L ||       || O ||        || V ||        || E ||       || . ||      
      134                  _.' \`-' '._  _.' \`-' '._  _.' \`-' '._  _.' \`-' '._  _.' \`-' '._  _.' 
      135                 (.-./\`-'\\.-.)(.-./\`-'\\.-.)(.-./\`-'\\.-.)(.-./\`-'\\.-.)(.-./\`-'\\.-.)
      136                 \`-'     \`-'  \`-'     \`-'  \`-'     \`-'  \`-'     \`-'  \`-'     \`-'  `]
      137         },
      138         // 錯誤提示
      139         onErrors: config.dev.notifyOnErrors ?
      140           utils.createNotifierCallback() : undefined
      141       }))
      142 
      143       resolve(devWebpackConfig)
      144     }
      145   })
      146 })

       

      posted @ 2020-12-02 16:35  思猿客  閱讀(2136)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 怡红院一区二区三区在线| 国产二区三区不卡免费| 欧洲亚洲国内老熟女超碰| 午夜精品久久久久久久久| 18禁一区二区每日更新| 国产成人一区二区不卡| 欧美日韩国产亚洲沙发| 人妻少妇无码精品专区| 国产精品成人午夜福利| 国产日韩精品免费二三氏| 99久久久无码国产精品免费| 日韩a∨精品日韩在线观看| 久久久久国产精品人妻| 国产精品免费观看色悠悠| 2020无码专区人妻系列日韩| 国产成人午夜精品永久免费| 免费无码肉片在线观看| 免费人成在线观看网站| 国产精品成人高潮av| 黄山市| 99久久婷婷国产综合精品青草漫画| 国产成人精品无码免费看| 古交市| 欧美日韩另类国产| 亚洲老熟女一区二区三区 | 人妻放荡乱h文| 亚洲精品综合网中文字幕| 成人午夜免费无码视频在线观看| 精品无码国产一区二区三区AV| 国产成人精品白浆免费视频试看| 欧洲尺码日本尺码专线美国又| 中山市| 国产精品七七在线播放| 色色97| 麻豆久久天天躁夜夜狠狠躁| 亚洲男人AV天堂午夜在| 午夜爽爽爽男女免费观看影院| 亚洲人成小说网站色在线| 亚洲国产精品综合久久2007| 亚洲av成人精品日韩一区 | 国产亚洲精品成人aa片新蒲金|