
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@definejs/cli
Advanced tools
用于打包 definejs 的命令行工具。
建议使用全局安装,以便可以在任一目录中使用命令。
npm install -g @definejs/cli
首次使用时,请先初始化一个目录,以便可以生成指定类型的模板配置文件到该目录,避免从头手写一个配置文件。
definejs init <template-name> [project-name]
template-name 必选,要使用的配置文件的类型,可选的值有
default:一个只有字段没有值的、空的配置文件。
mobile:针对移动端进行打包的配置文件,包含常用的模块,以便打包出来的库文件能用于移动端开发。
pc:针对 PC 端进行打包的配置文件,包含常用的模块,以便打包出来的库文件能用于 PC 端开发。
project-name 可选,要在当前目录创建的子目录,以便作为项目的专用目录。 如果不指定则以当前目录为项目目录。
以当前目录为项目的目录,以 pc 类型为模板,初始化一个针对于 PC 端开发的打包配置文件。
definejs init pc
在当前目录创建一个子目录 mob 为项目的目录,以 mobile 类型为模板,初始化一个针对于移动端开发的打包配置文件。
definejs init mobile mob
执行初始化操作后,当前目录(或指定的子目录作为项目的目录)将会创建一个 config.js 文件。
该文件是打包工具要用到的配置文件,用户可以自行修改以进行高级的定制。
在一个包含有 config.js 文件的目录中执行 definejs pack 命令即可开始打包。
definejs pack
命令 definejs pack 可以带有多项参数,以进行更精细的控制。
| 名称 | 简写 | 类型 | 描述 |
|---|---|---|---|
| --no-install | -u | boolean | 是否不从 npm 进行安装要用于打包的源包 |
FAQs
definejs cli tools for init and pack definejs packages.
We found that @definejs/cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.