Code Monkey home page Code Monkey logo

shop_admin's Introduction

manger

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint

Customize configuration

See Configuration Reference.

// const CompressionPlugin = require('compression-webpack-plugin')

module.exports = { publicPath: './', assetsDir: 'static', outputDir: 'dist', devServer: { https: false, open: true, // 自动开启浏览器 compress: false, // 开启压缩 overlay: { warnings: true, errors: true }, proxy: { [process.env.VUE_APP_BASE_API]: { target: process.env.VUE_APP_SERVICE_URL, changeOrigin: true, ws: true, secure: false, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: '' } } } }, configureWebpack: {//这里是添加的部分 externals:{ // 'vue': 'Vue', // 'vue-router': 'VueRouter', // 'vuex': 'Vuex', // 'element-ui': 'ELEMENT', // 'axios': 'axios', } },
chainWebpack: (config) => {
config.plugins.delete('prefetch')

    /* 添加分析工具*/
    if (process.env.NODE_ENV === 'production') {
        if (process.env.npm_config_report) {
            config
                .plugin('webpack-bundle-analyzer')
                .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin).end();
            config.plugins.delete('prefetch')
        }
        config.mode = 'production'
        // return {
        //     plugins: [new CompressionPlugin({
        //         test: /.js$|.html$|.css/, //匹配文件名
        //         threshold: 10240, //对超过10k的数据进行压缩
        //         deleteOriginalAssets: false //是否删除原文件
        //     })]
        // }
    }
},

productionSourceMap: false, //不生成.map文件

}

shop_admin's People

Contributors

liuyongxin-star avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.