首页 技术 正文
技术 2022年11月24日
0 收藏 425 点赞 3,881 浏览 946 个字

一、概述

1.1、官方地址以及说明

  由于 Ant Design Pro 底层使用的 roadhog 工具,已经将复杂的流程封装完毕,对于大部分场景,构建打包文件只需要一个命令 roadhog build,构建打包成功之后,会在根目录生成 dist 文件夹,里面就是构建打包好的文件,通常是 ***.js***.cssindex.html 等静态文件。

  意思是使用默认package.json中的build即可

1.2、定制化打包

  通过设置.webpackrc.js实现定制化打包。内部参数设置

开发线上区分

"env": {
// 开发环境
"development": {
"extraBabelPlugins": [
"dva-hmr",
]
},
// build 时的生产环境
"production": {
"extraBabelPlugins": [
"transform-runtime",
"transform-decorators-legacy",
["import", { "libraryName": "antd", "style": true }]
]
}
},

1.3、针对文件目录定制化.webpackrc.js

其实主要是设置.webpackrc.js

官方地址:https://github.com/sorrycc/roadhog

中文地址:https://github.com/sorrycc/roadhog/blob/master/README_zh-cn.md

常用配置:

  publicPath

    配置 webpack 的 output.publicPath 属性。

  outputPath

    配置 webpack 的?output.path?属性。

  copy

    定义需要单纯做复制的文件列表,格式为数组,项的格式参考 copy-webpack-plugin 的配置。

    比如:

"copy": [
{ "from": "", "to": "" }
]

1.4、探究

  查看可知,pro ant design 打包→roadhog 打包→webpack打包

  webpack地址:https://webpack.js.org/configuration/

  中文地址:https://webpack.docschina.org/concepts/


    					
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,291
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,718
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,554
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,325
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,963
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,123