@theatrejs/loader-aseprite 1.4.1 → 1.6.0
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 +4 -4
- package/sources/aseprite.loader.js +17 -17
package/package.json
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
},
|
|
12
12
|
"engines": {
|
|
13
13
|
|
|
14
|
-
"node": "
|
|
15
|
-
"npm": "8.1
|
|
14
|
+
"node": "18.18.2",
|
|
15
|
+
"npm": "9.8.1"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"name": "@theatrejs/loader-aseprite",
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
|
|
47
|
-
"@theatrejs/plugin-aseprite": ">= 1.
|
|
47
|
+
"@theatrejs/plugin-aseprite": ">= 1.8.0",
|
|
48
48
|
"webpack": ">= 5.94.0"
|
|
49
49
|
},
|
|
50
50
|
"repository": {
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"postversion": "node ./tools/custom/postversion.cjs"
|
|
58
58
|
},
|
|
59
59
|
"type": "commonjs",
|
|
60
|
-
"version": "1.
|
|
60
|
+
"version": "1.6.0"
|
|
61
61
|
}
|
|
@@ -47,30 +47,30 @@ module.exports = function loader() {
|
|
|
47
47
|
throw $error;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
try {
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
const location = path.dirname(file);
|
|
53
|
+
const filename = path.basename(file, '.aseprite');
|
|
54
|
+
const sourceTexture = filename + '.png';
|
|
55
|
+
const sourceData = filename + '.json';
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
if (fs.existsSync(path.resolve(location, sourceTexture)) === false
|
|
58
|
+
|| fs.existsSync(path.resolve(location, sourceData)) === false
|
|
59
|
+
|| fs.statSync(path.resolve(location, sourceTexture)).mtime < fs.statSync(file).mtime
|
|
60
|
+
|| fs.statSync(path.resolve(location, sourceData)).mtime < fs.statSync(file).mtime) {
|
|
56
61
|
|
|
57
|
-
|
|
58
|
-
}
|
|
62
|
+
if (typeof aseprite === 'undefined') {
|
|
59
63
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const sourceTexture = filename + '.png';
|
|
63
|
-
const sourceData = filename + '.json';
|
|
64
|
+
throw new Error('Aseprite executable path is missing in the loader options.');
|
|
65
|
+
}
|
|
64
66
|
|
|
65
|
-
|
|
66
|
-
const sheetType = (typeof prepare !== 'undefined' && ['colums', 'horizontal', 'packed', 'rows', 'vertical'].indexOf(prepare.sheet) !== -1) ? prepare.sheet : 'rows';
|
|
67
|
+
if (fs.existsSync(aseprite) === false) {
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
throw new Error('Aseprite executable not found reading path: ' + (typeof aseprite !== 'undefined' || aseprite !== '' ? '\'' + aseprite + '\'' : '<empty>') + '.');
|
|
70
|
+
}
|
|
69
71
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|| fs.statSync(path.resolve(location, sourceTexture)).mtime < fs.statSync(file).mtime
|
|
73
|
-
|| fs.statSync(path.resolve(location, sourceData)).mtime < fs.statSync(file).mtime) {
|
|
72
|
+
const trim = (typeof prepare !== 'undefined' && prepare.trim === true) ? ' --trim' : '';
|
|
73
|
+
const sheetType = (typeof prepare !== 'undefined' && ['colums', 'horizontal', 'packed', 'rows', 'vertical'].indexOf(prepare.sheet) !== -1) ? prepare.sheet : 'rows';
|
|
74
74
|
|
|
75
75
|
subprocess.execSync(
|
|
76
76
|
|