makepack 1.6.7 → 1.6.8
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.
package/package.json
CHANGED
|
@@ -135,22 +135,8 @@ const build = async (args) => {
|
|
|
135
135
|
const pkgPath = path.join(process.cwd(), 'package.json');
|
|
136
136
|
if (fs.existsSync(pkgPath)) {
|
|
137
137
|
const pkgjson = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
138
|
-
if (args.format === 'default') {
|
|
139
|
-
pkgjson.main = "./index.cjs";
|
|
140
|
-
pkgjson.module = "./index.mjs";
|
|
141
|
-
pkgjson.types = './index.d.ts'
|
|
142
|
-
} else {
|
|
143
|
-
let t = args.format === 'mjs' ? 'module' : 'main';
|
|
144
|
-
pkgjson[t] = `./index.${args.format}`;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (args.declaration) {
|
|
148
|
-
pkgjson.types = `./index.d.ts`;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
138
|
delete pkgjson.scripts
|
|
152
139
|
delete pkgjson.type
|
|
153
|
-
|
|
154
140
|
fs.writeFileSync(path.join(outdir, 'package.json'), JSON.stringify(pkgjson, null, 2));
|
|
155
141
|
} else {
|
|
156
142
|
spinner.fail("package.json not found!");
|