makepack 1.3.2 → 1.3.4
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 +1 -1
- package/src/actions/pack/index.js +2 -1
- package/src/helpers.js +3 -1
package/package.json
CHANGED
|
@@ -15,13 +15,14 @@ const pack = async (args) => {
|
|
|
15
15
|
const entries = files.map(entry => path.join(process.cwd(), entry))
|
|
16
16
|
let loader = logLoader("Generating a production build for the package...")
|
|
17
17
|
const esbuildConfig = await loadConfig('esbuild.config.js') || {}
|
|
18
|
+
|
|
18
19
|
esbuild.buildSync({
|
|
19
20
|
// minify: true,
|
|
20
21
|
sourcemap: true,
|
|
21
22
|
format: "esm",
|
|
22
23
|
platform: 'node',
|
|
23
24
|
loader: { '.ts': 'ts' },
|
|
24
|
-
tsconfig: path.join(process.cwd(), 'tsconfig.json'),
|
|
25
|
+
// tsconfig: path.join(process.cwd(), 'tsconfig.json'),
|
|
25
26
|
...esbuildConfig,
|
|
26
27
|
entryPoints: entries,
|
|
27
28
|
outdir: path.join(process.cwd(), args.outdir),
|
package/src/helpers.js
CHANGED
|
@@ -3,6 +3,7 @@ import chalk from 'chalk';
|
|
|
3
3
|
import figures from 'figures';
|
|
4
4
|
import { pathToFileURL } from 'url';
|
|
5
5
|
import path from 'path';
|
|
6
|
+
import fs from 'fs-extra';
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
export const logLoader = (message = "") => {
|
|
@@ -61,7 +62,8 @@ export const loadConfig = async (file) => {
|
|
|
61
62
|
const viteConfigPath = path.resolve(process.cwd(), file);
|
|
62
63
|
if (fs.existsSync(viteConfigPath)) {
|
|
63
64
|
try {
|
|
64
|
-
|
|
65
|
+
const c = await import(pathToFileURL(viteConfigPath).href)
|
|
66
|
+
return c.default || {}
|
|
65
67
|
} catch (error) {
|
|
66
68
|
}
|
|
67
69
|
}
|