asajs 4.0.3-preview → 4.0.4-preview

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.
@@ -1,12 +1,13 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
- if (!fs.existsSync("asajs.config.cjs")) {
4
- fs.copyFileSync("node_modules/asajs/resources/asajs.config.cjs", "asajs.config.cjs");
3
+ import { createRequire } from "module";
4
+ if (!fs.existsSync("asajs.config.js")) {
5
+ fs.copyFileSync("node_modules/asajs/resources/asajs.config.js", "asajs.config.js");
5
6
  }
6
7
  if (!fs.existsSync(".gitignore")) {
7
8
  fs.writeFileSync(".gitignore", `node_modules`, "utf-8");
8
9
  }
9
- export const config = require(path.resolve(process.cwd(), "asajs.config.cjs")).config;
10
+ export const config = createRequire(import.meta.url)(path.resolve(process.cwd(), "asajs.config.js")).config;
10
11
  export let isBuildMode = config.compiler?.enabled ?? false;
11
12
  export let isLinkMode = config.compiler?.autoImport ?? false;
12
13
  export let unLinked = !(config.compiler?.autoImport ?? true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asajs",
3
- "version": "4.0.3-preview",
3
+ "version": "4.0.4-preview",
4
4
  "description": "Create your Minecraft JSON-UI resource packs using JavaScript",
5
5
  "keywords": [
6
6
  "Minecraft",
File without changes