@vnejs/build 0.0.22 → 0.0.24

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/build",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "description": "Build tools for @vnejs",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -4,20 +4,28 @@ const { Command } = require("commander");
4
4
 
5
5
  const packageJson = require("../package.json");
6
6
 
7
+ const getRootDir = () => process.env.PWD || process.env.INIT_CWD;
8
+
7
9
  const program = new Command();
8
10
 
9
- program.name(packageJson.name).description(packageJson.description).version(packageJson.version);
11
+ program
12
+ //
13
+ .name(packageJson.name)
14
+ .description(packageJson.description)
15
+ .version(packageJson.version);
10
16
 
11
17
  program
18
+ //
12
19
  .command("data")
13
20
  .option("-w, --watch", "watch mode", false)
14
21
  .option("-q, --quiet", "no console mode", false)
15
- .action(require("./data")(process.env.PWD));
22
+ .action(require("./data")(getRootDir()));
16
23
 
17
24
  program
25
+ //
18
26
  .command("client")
19
27
  .option("-w, --watch", "watch mode", false)
20
28
  .option("-q, --quiet", "no console mode", false)
21
- .action(require("./client")(process.env.PWD));
29
+ .action(require("./client")(getRootDir()));
22
30
 
23
31
  program.parse();
package/src/data/utils.js CHANGED
@@ -31,7 +31,7 @@ const getFilesInDir = (dirPath, prefix = "") => {
31
31
 
32
32
  const prepareMediaInfo = (mediaDir, mediaSubType = null) =>
33
33
  getFilesInDir(path.join(mediaDir, mediaSubType)).reduce((acc, file) => {
34
- acc[file.slice(0, -path.parse(file).ext.length)] = `/media/${mediaSubType}/${file}`;
34
+ acc[file.slice(0, -path.parse(file).ext.length)] = `media/${mediaSubType}/${file}`;
35
35
 
36
36
  return acc;
37
37
  }, {});