@frefly/print-build-info 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +4 -4
  2. package/package.json +7 -2
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { execSync } from 'node:child_process'
2
- import fs from 'node:fs'
3
- import path from 'node:path'
1
+ const { execSync } = require('node:child_process')
2
+ const fs = require('node:fs')
3
+ const path = require('node:path')
4
4
 
5
5
  /**
6
6
  * 执行 git 命令并返回 trim 后的输出;命令失败时返回空字符串
@@ -20,7 +20,7 @@ const safeGit = cmd => {
20
20
  * @param {Record<string, string>} env Vite loadEnv 返回的环境变量对象
21
21
  * @returns {import('vite').Plugin}
22
22
  */
23
- export const printBuildInfo = env => {
23
+ module.exports.printBuildInfo = env => {
24
24
  let projectRoot = process.cwd()
25
25
  let startTime = 0
26
26
  let written = false
package/package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "name": "@frefly/print-build-info",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "前端打包信息输出配置",
5
- "type": "module",
5
+ "keywords": [
6
+ "print",
7
+ "build",
8
+ "env"
9
+ ],
10
+ "type": "commonjs",
6
11
  "main": "index.js",
7
12
  "exports": {
8
13
  ".": "./index.js"