zoukankan      html  css  js  c++  java
  • vue文件添加编译


    指令:1: npm install vue-loader vue-template-compiler --save-dev

    2:config中配置

    {
    test: /.vue$/,
    exclude: /(node_modules|bower_components)/,
    use: ['vue-loader']
    }

    3:当版本编译失败时可以适当降低版本,如果过高,要安装插件,建议^13.0.0

    打包...

     npm install html-webpack-plugin --save-dev

    const HtmlWebpackPlugin= require('html-webpack-plugin')
    new HtmlWebpackPlugin({
    template: 'index.html',
    }),

    压缩版本

    npm install uglifyjs-webpack-plugin@1.1.1 --save -dev

    const uglifyjsWebpack = require('uglifyjs-webpack-plugin')

    new uglifyjsWebpack(),



    安装express框架
    ============================

    一:npm install --save -dev webpack-dev-server@2.9.3

    二:

    devServer:{
    contentBase:'./dist',
    inline: true
    }

    三:dev脚本

    "scripts": {
    "test": "echo "Error: no test specified" && exit 1",
    "build": "webpack",
    "dev": "webpack-dev-server --open"
    },


     配置分离

    1: npm install webpack-merge --save -dev

     2:引入

    const uglifyjsWebpack = require('uglifyjs-webpack-plugin')
    const webpackMerge = require('webpack-merge')
    const baseConfig = require('./base.config')
    module.exports=webpackMerge(baseConfig, {
    plugins:[
    new uglifyjsWebpack(),
    ],
    })

    3:更改输出路径
    如有错误,请邮件zs253499660@sina.com,如有更好的方法,可以推荐
  • 相关阅读:
    redis_ 5 集群
    redis_4 主从模式
    redis_3 持久化
    redis_2 数据类型
    linux_ubuntu 连接xftp
    redis_1 安装和简单使用
    Activiti 各个节点涉及的表
    oracle 数据库imp操作导入dmp文件时表空间问题
    ORA-27101: shared memory realm does not exist 错误的处理
    oralce清理user 和tablespace.
  • 原文地址:https://www.cnblogs.com/senjiang/p/11867653.html
Copyright © 2011-2022 走看看