@inglorious/ssx 1.3.3 → 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.
Files changed (2) hide show
  1. package/bin/ssx.js +13 -9
  2. package/package.json +1 -1
package/bin/ssx.js CHANGED
@@ -32,7 +32,9 @@ program
32
32
  .option("-p, --port <port>", "dev server port", 3000)
33
33
  .action(async (options) => {
34
34
  const cwd = process.cwd()
35
- const configPath = resolveConfigFile(options.config)
35
+ const rootDir = path.resolve(cwd, options.root)
36
+ const configPath = resolveConfigFile(rootDir, options.config)
37
+ const port = Number(options.port)
36
38
 
37
39
  try {
38
40
  await dev({
@@ -40,8 +42,8 @@ program
40
42
  config: undefined,
41
43
  root: undefined,
42
44
  configPath,
43
- rootDir: path.resolve(cwd, options.root),
44
- port: Number(options.port),
45
+ rootDir,
46
+ port,
45
47
  })
46
48
  } catch (error) {
47
49
  console.error("Dev server failed:", error)
@@ -59,7 +61,9 @@ program
59
61
  .option("-f, --force", "force clean build (ignore cache)", false)
60
62
  .action(async (options) => {
61
63
  const cwd = process.cwd()
62
- const configPath = resolveConfigFile(options.config)
64
+ const rootDir = path.resolve(cwd, options.root)
65
+ const configPath = resolveConfigFile(rootDir, options.config)
66
+ const outDir = path.resolve(cwd, options.out)
63
67
 
64
68
  try {
65
69
  await build({
@@ -68,8 +72,8 @@ program
68
72
  root: undefined,
69
73
  out: undefined,
70
74
  configPath,
71
- rootDir: path.resolve(cwd, options.root),
72
- outDir: path.resolve(cwd, options.out),
75
+ rootDir,
76
+ outDir,
73
77
  })
74
78
 
75
79
  // if (result.skipped) {
@@ -85,10 +89,10 @@ program
85
89
 
86
90
  program.parse()
87
91
 
88
- function resolveConfigFile(configFile) {
92
+ function resolveConfigFile(rootDir, configFile) {
89
93
  if (configFile === "site.config.js") {
90
- const jsPath = path.resolve(process.cwd(), "site.config.js")
91
- const tsPath = path.resolve(process.cwd(), "site.config.ts")
94
+ const jsPath = path.resolve(rootDir, "site.config.js")
95
+ const tsPath = path.resolve(rootDir, "site.config.ts")
92
96
 
93
97
  if (!existsSync(jsPath) && existsSync(tsPath)) {
94
98
  return "site.config.ts"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inglorious/ssx",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Server-Side-X. Xecution? Xperience? Who knows.",
5
5
  "author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
6
6
  "license": "MIT",