![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@epig/af-build-dev
Advanced tools
基于af-webpack的前端构建编译工具,可零配置开箱使用
$ npm i @epig/af-build-dev --save-dev
$ npm i @epig/af-build-dev -g #全局安装
$ epig dev # 启动开发服务器
$ epig build # 构建项目
只列部分,详细参考af-webpack源码;
NAME | NOTES | DEFAULT_VALUE |
---|---|---|
PROT | 服务器端口 | 8000 |
ANALYZE | webpack-bundle-analyzer 插件开关 | undefined |
SPEED_MEASURE | speed-measure-webpack-plugin 插件开关 | undefined |
COMPORESS | 压缩混淆js文件选项 | undefined |
POLYFILL | babel polyfill 选项 | undefined |
参考af-webpack中的webpack配置项,推荐在.epigrc.js
文件中配置
由于af-build-dev内建chainConfig支持,请不要配置chainConfig,其他配置项和合并到内置配置项。
在此配置文件中也可以配置 .webpackrc.js 的同名配置项,会合并使用(优先级:.epigrc.js>.webpackrc.js), 但是配置在此的配置项不会进行检查。
通过数组的形式进行配置,第一项是插件名字或自定义插件,第二项(可选)为传进插件的参数,类似babel的配置方式
类型 Array
example
plugins: [
['epig-plugin-admin', {noAutoRoute: true}],
]
支持链式配置webpack配置,参考webpack-chain
类型 Function
example
chainWebpack(chainConfig, { webpack }) {
// 设置 alias
chainConfig.resolve.alias.set('a', 'path/to/a');
}
babel语法兼容配置,参考@babel/preset-env
类型 Object
example
// 开启ie11支持
targets: {
ie: 11,
}
构建时是否开启gzip压缩,生成的gz文件需配合express-static-gzip
使用。参考example
类型 Boolean
example
gzip:true
将script脚本注入到html模板中,支持head
以及body
注入位置,支持src
或者content
模式;
export interface ScriptEnhanceOption {
area?: 'head' | 'body';
src?: string;
content?: string;
}
scripts: [{
src: 'https://as.alipayobjects.com/g/component/fastclick/1.0.6/fastclick.js',
}, {
content: 'window.test="test";',
}, {
area: 'body',
content: 'window.end="end";',
}]
FAQs
基于af-webpack的前端构建编译工具
We found that @epig/af-build-dev demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.