/ / reference NPM IP packet, which is used to get the local IP operation, such as document address: https://www.npmjs.com/package/ip
const ip = require('ip')

Packages / / reference path (path belong to the node bring their own bags, don't need in the package. The json can be referenced in the installation direct reference), is used to operating path, document address: https://nodejs.org/docs/latest/api/path.html
const path = require('path')

// The NPM html-webpack-inline-plugin package is used to compress the contents of the 
const HtmlWebpackInlinePlugin = require('html-webpack-inline-plugin')

// Reference the NPM filemanager-webpack-plugin package, which is used to manipulate files, allow copying, archive into (.zip/.tar/.tar.gz), move, delete files and directories before or before build: https://www.npmjs.com/package/filemanager-webpack-plugin
const FileManagerPlugin = require('filemanager-webpack-plugin')


// Vue.config. js Exported configuration items
module.exports = {
    publicPath: process.env.NODE_ENV === "production" ? "" : "/".// The base URL when deploying the application package. The usage is consistent with the output.publicpath of webpack itself
    outputDir:process.env.NODE_ENV === "production" ? "dist" : "devdist".// Package path address,Default: 'dist', instead of output.path
    assetsDir:'assets'.// Place the generated static resources (js, CSS, img, fonts) in the directory (relative to outputDir)
    indexPath:'index.html' ,// Static template file output address
    filenameHashing:true.// By default, generated static resources include hash in their file names for better cache control
    lintOnSave:false.// EsLint validation is not required
    parallel:4.// Whether to compress with multiple threads
    // For multi-page developmentPages: {index: {
          // Page entry
          entry: 'src/index/main.js'.// Template source
          template: 'public/index.html'.// Output in dist/index.html
          filename: 'index.html'.// When using the title option,
          / / title of the template tag needs to be < title > < % = htmlWebpackPlugin. Options. The title % > < / title >
          title: 'Index Page'.// The blocks contained in this page are contained by default
          // The extracted generic chunk and Vendor chunk.
          chunks: ['chunk-vendors'.'chunk-common'.'index']},// When using the entry only string format,
        // The template will be derived to 'public/subpage.html'
        // And if it can't be found, go back to 'public/index.html'.
        // The output file name is derived to 'subpage.html'.
        subpage: 'src/subpage/main.js'},// whether eslint-loader is checked at save time (@vue/cli-plugin-eslint takes effect after installation)
    lintOnSave: process.env.NODE_ENV ! = ='production'./ / value: Boolean | 'warning' | 'default' | 'error'
    // Whether to use the Vue build with the runtime compiler
    runtimeCompiler: false.// By default, babel-loader ignores all files in node_modules (explicitly translating a dependency through Babel, which can be listed in this option)
    transpileDependencies: [].// Whether the production environment generates the sourceMap file
    productionSourceMap: false.// Set the Crossorigin attribute for the 
       and 
    crossorigin: ' '.// Enable Subresource Integrity (SRI) on the 
       and 
    integrity: false.configureWebpack:(config) = >{
        if (process.env.NODE_ENV === 'production') {      
          // Production environment
          config.mode = 'production'
        } else {      
          // Development environment
          config.mode = 'development'}},// CSS related configurations
    css: {
        // Whether to enable CSS modules for all CSS/pre-processor files.
        requireModuleExtension: false
        // Whether to extract CSS (ExtractTextPlugin)
        extract: true.// Whether to enable CSS source maps
        sourceMap: false.// Enable CSS modules for all CSS/pre-processor files.
        modules: false
        // CSS default configuration item
        loaderOptions: {
            css: {
                // The options here are passed to csS-loader
            },
            postcss: {
                // The options here are passed to postCSS-loader
            },
            sass: {
                prependData: `@import "./src/styles/main.scss"; `}}},// webpack-dev-server configuration
    devServer: {open: false.// Whether to open the page after compiling
        host: '0.0.0.0'.// Specify the address to use, default localhost,0.0.0.0 indicates that external access
        port: 8080.// Access the port
        https: false.// Refresh the page when compilation fails
        hot: true.// Enable hot loading
        hotOnly: false.// HTTP proxy configuration
        proxy: {      
          '/api': {
            target: 'http://127.0.0.1:3000/api'.ws: true.changeOrigin: true.pathRewrite: {          
                '^/api': ' '}}}},// Whether to use thread-loader for compression
    parallel: require('os').cpus().length > 1./ / PWA plug-in related configuration, https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa
    pwa: {},
    // Third-party plug-in configuration
    pluginOptions: {}}Copy the code