drgame-cc 1.0.5 → 1.0.7
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/gulpfile.js +68 -0
- package/package.json +3 -1
- package/tsconfig.json +26 -0
package/gulpfile.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const gulp = require("gulp");
|
|
3
|
+
const minify = require('gulp-minify');
|
|
4
|
+
const ts = require('gulp-typescript');
|
|
5
|
+
const tsProject = ts.createProject('tsconfig.json');
|
|
6
|
+
const inject = require('gulp-inject-string');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
|
|
10
|
+
function loadEnvFile() {
|
|
11
|
+
const envPath = path.join(__dirname, '.env');
|
|
12
|
+
if (fs.existsSync(envPath)) {
|
|
13
|
+
const envContent = fs.readFileSync(envPath, 'utf-8');
|
|
14
|
+
envContent.split('\n').forEach(line => {
|
|
15
|
+
const trimmedLine = line.trim();
|
|
16
|
+
if (trimmedLine && !trimmedLine.startsWith('#')) {
|
|
17
|
+
const [key, ...valueParts] = trimmedLine.split('=');
|
|
18
|
+
if (key && valueParts.length > 0) {
|
|
19
|
+
const value = valueParts.join('=').trim();
|
|
20
|
+
if (!process.env[key]) {
|
|
21
|
+
process.env[key] = value.replace(/^["']|["']$/g, '');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
loadEnvFile();
|
|
30
|
+
|
|
31
|
+
const COCOS_ROOT = process.env.COCOS_CREATOR_ROOT || '..';
|
|
32
|
+
const TVUI_DEST = path.join(COCOS_ROOT, 'assets/resources/tvui');
|
|
33
|
+
|
|
34
|
+
gulp.task('buildJs', () => {
|
|
35
|
+
return tsProject.src()
|
|
36
|
+
.pipe(tsProject())
|
|
37
|
+
.pipe(gulp.dest('./bin'));
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
gulp.task("buildDts", () => {
|
|
41
|
+
return tsProject.src()
|
|
42
|
+
.pipe(tsProject())
|
|
43
|
+
.pipe(gulp.dest('./bin'));
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
gulp.task("copyBuildTemplates", () => {
|
|
47
|
+
return gulp.src('build-templates/**/*')
|
|
48
|
+
.pipe(gulp.dest(path.join(COCOS_ROOT, 'build-templates')));
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
gulp.task("copyTvui", () => {
|
|
52
|
+
if (!fs.existsSync(TVUI_DEST)) {
|
|
53
|
+
fs.mkdirSync(TVUI_DEST, { recursive: true });
|
|
54
|
+
}
|
|
55
|
+
return gulp.src('tvui/**/*')
|
|
56
|
+
.pipe(gulp.dest(TVUI_DEST));
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
gulp.task("copyResources", gulp.parallel(
|
|
60
|
+
'copyBuildTemplates',
|
|
61
|
+
'copyTvui'
|
|
62
|
+
));
|
|
63
|
+
|
|
64
|
+
gulp.task('build', gulp.series(
|
|
65
|
+
gulp.parallel('buildJs'),
|
|
66
|
+
gulp.parallel('buildDts'),
|
|
67
|
+
gulp.parallel('copyResources'),
|
|
68
|
+
))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drgame-cc",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Cocos Creator 资源导出工具包 - 支持预制体、图片、音乐等资源导出",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -43,6 +43,8 @@
|
|
|
43
43
|
"build-templates/**/*",
|
|
44
44
|
"scripts/postinstall.js",
|
|
45
45
|
"bin/**/*",
|
|
46
|
+
"gulpfile.js",
|
|
47
|
+
"tsconfig.json",
|
|
46
48
|
"README.md"
|
|
47
49
|
],
|
|
48
50
|
"engines": {
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "amd",
|
|
4
|
+
"lib": [
|
|
5
|
+
"dom",
|
|
6
|
+
"es5",
|
|
7
|
+
"es2015.promise"
|
|
8
|
+
],
|
|
9
|
+
"target": "es5",
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"outFile": "./drgame.js",
|
|
12
|
+
"declaration": true,
|
|
13
|
+
"sourceMap": false,
|
|
14
|
+
"removeComments": true,
|
|
15
|
+
"experimentalDecorators": true,
|
|
16
|
+
"emitDecoratorMetadata": true
|
|
17
|
+
},
|
|
18
|
+
"include": [
|
|
19
|
+
"src",
|
|
20
|
+
"lib"
|
|
21
|
+
],
|
|
22
|
+
"exclude": [
|
|
23
|
+
"node_modules",
|
|
24
|
+
"test"
|
|
25
|
+
]
|
|
26
|
+
}
|