Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@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的前端构建编译工具
The npm package @epig/af-build-dev receives a total of 0 weekly downloads. As such, @epig/af-build-dev popularity was classified as not popular.
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.