@jayfong/x-server 2.76.0 → 2.76.2
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/lib/_cjs/cli/build_util.js +4 -3
- package/lib/_cjs/cli/cli.js +5 -4
- package/lib/cli/build_util.js +4 -3
- package/lib/cli/cli.js +5 -4
- package/package.json +3 -5
|
@@ -84,7 +84,7 @@ class BuildUtil {
|
|
|
84
84
|
},
|
|
85
85
|
plugins: [{
|
|
86
86
|
name: 'extract-assets',
|
|
87
|
-
setup(build) {
|
|
87
|
+
async setup(build) {
|
|
88
88
|
build.onLoad({
|
|
89
89
|
filter: /\/svg-captcha\/lib\/option-manager\.js$/
|
|
90
90
|
}, async args => {
|
|
@@ -133,7 +133,7 @@ class BuildUtil {
|
|
|
133
133
|
filter: /@dev[\/\.]/
|
|
134
134
|
}, async () => {
|
|
135
135
|
return {
|
|
136
|
-
contents: '
|
|
136
|
+
contents: 'module.exports = {}',
|
|
137
137
|
loader: 'js'
|
|
138
138
|
};
|
|
139
139
|
});
|
|
@@ -146,7 +146,8 @@ class BuildUtil {
|
|
|
146
146
|
}, async args => {
|
|
147
147
|
if (excludeRegExps.some(re => re.test(args.path))) {
|
|
148
148
|
return {
|
|
149
|
-
|
|
149
|
+
// 不用 export {} 避免 esbuild 检测报错
|
|
150
|
+
contents: 'module.exports = {}',
|
|
150
151
|
loader: 'js'
|
|
151
152
|
};
|
|
152
153
|
}
|
package/lib/_cjs/cli/cli.js
CHANGED
|
@@ -185,11 +185,12 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
185
185
|
minify: argv.minify,
|
|
186
186
|
noInstall: argv['no-install'],
|
|
187
187
|
channel: channel,
|
|
188
|
-
excludeFiles: argv.exclude
|
|
189
|
-
return
|
|
188
|
+
excludeFiles: (argv.exclude ? (0, _vtils.castArray)(argv.exclude) : []).map(item => {
|
|
189
|
+
return _vtils.StringTemplate.render(item, envMap, {
|
|
190
190
|
code: true,
|
|
191
|
-
onlyCode: true
|
|
192
|
-
|
|
191
|
+
onlyCode: true,
|
|
192
|
+
beforeReplace: v => (0, _vtils.escapeRegExp)(v)
|
|
193
|
+
});
|
|
193
194
|
})
|
|
194
195
|
});
|
|
195
196
|
console.log('构建成功');
|
package/lib/cli/build_util.js
CHANGED
|
@@ -78,7 +78,7 @@ export class BuildUtil {
|
|
|
78
78
|
},
|
|
79
79
|
plugins: [{
|
|
80
80
|
name: 'extract-assets',
|
|
81
|
-
setup(build) {
|
|
81
|
+
async setup(build) {
|
|
82
82
|
build.onLoad({
|
|
83
83
|
filter: /\/svg-captcha\/lib\/option-manager\.js$/
|
|
84
84
|
}, async args => {
|
|
@@ -127,7 +127,7 @@ export class BuildUtil {
|
|
|
127
127
|
filter: /@dev[\/\.]/
|
|
128
128
|
}, async () => {
|
|
129
129
|
return {
|
|
130
|
-
contents: '
|
|
130
|
+
contents: 'module.exports = {}',
|
|
131
131
|
loader: 'js'
|
|
132
132
|
};
|
|
133
133
|
});
|
|
@@ -140,7 +140,8 @@ export class BuildUtil {
|
|
|
140
140
|
}, async args => {
|
|
141
141
|
if (excludeRegExps.some(re => re.test(args.path))) {
|
|
142
142
|
return {
|
|
143
|
-
|
|
143
|
+
// 不用 export {} 避免 esbuild 检测报错
|
|
144
|
+
contents: 'module.exports = {}',
|
|
144
145
|
loader: 'js'
|
|
145
146
|
};
|
|
146
147
|
}
|
package/lib/cli/cli.js
CHANGED
|
@@ -183,11 +183,12 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
183
183
|
minify: argv.minify,
|
|
184
184
|
noInstall: argv['no-install'],
|
|
185
185
|
channel: channel,
|
|
186
|
-
excludeFiles: argv.exclude
|
|
187
|
-
return
|
|
186
|
+
excludeFiles: (argv.exclude ? castArray(argv.exclude) : []).map(item => {
|
|
187
|
+
return StringTemplate.render(item, envMap, {
|
|
188
188
|
code: true,
|
|
189
|
-
onlyCode: true
|
|
190
|
-
|
|
189
|
+
onlyCode: true,
|
|
190
|
+
beforeReplace: v => escapeRegExp(v)
|
|
191
|
+
});
|
|
191
192
|
})
|
|
192
193
|
});
|
|
193
194
|
console.log('构建成功');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jayfong/x-server",
|
|
3
|
-
"version": "2.76.
|
|
3
|
+
"version": "2.76.2",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "lib/_cjs/index.js",
|
|
@@ -9,9 +9,7 @@
|
|
|
9
9
|
"bin": {
|
|
10
10
|
"xs": "lib/_cjs/cli/cli.js"
|
|
11
11
|
},
|
|
12
|
-
"files": [
|
|
13
|
-
"lib"
|
|
14
|
-
],
|
|
12
|
+
"files": ["lib"],
|
|
15
13
|
"scripts": {
|
|
16
14
|
"build": "haoma compile",
|
|
17
15
|
"build_test_pkg": "tyn build && rm -rf ./lib_test && mkdir -p ./lib_test && cp -r ./lib ./lib_test/lib && cp ./package.json ./lib_test/package.json && cd ./tests/app && tyn add file:../../lib_test",
|
|
@@ -71,7 +69,7 @@
|
|
|
71
69
|
"unplugin-macros": "^0.16.0",
|
|
72
70
|
"utf-8-validate": "^5.0.9",
|
|
73
71
|
"vscode-generate-index-standalone": "^1.7.1",
|
|
74
|
-
"vtils": "^4.
|
|
72
|
+
"vtils": "^4.130.1",
|
|
75
73
|
"yaml": "^2.3.1",
|
|
76
74
|
"yargs": "^17.4.1"
|
|
77
75
|
},
|