Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 5864a0a

Browse files
committed
fix: 打包、交互优化
1 parent 3e57726 commit 5864a0a

File tree

5 files changed

+51
-22
lines changed

5 files changed

+51
-22
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ package-lock.json
1010
# company
1111
upload.js
1212
env.js
13+
.env.*
1314

1415
# testing
1516
/coverage

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "nutui-issue-helper",
3-
"version": "0.1.0",
3+
"version": "1.0.0",
44
"private": true,
55
"scripts": {
66
"dev": "vite",
7-
"build": "vite build",
8-
"upload": "yarn build && NODE_ENV=dev node upload.js"
7+
"build": "vite build --mode staging",
8+
"build:online": "vite build",
9+
"upload": "yarn build && node upload.js"
910
},
1011
"dependencies": {
1112
"@jd/upload-oss-tools": "^1.1.21",

src/components/App.vue

+2
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ export default {
232232
margin: 15px 0 8px
233233
p
234234
font-size 14px
235+
.vue-ui-button.flat>.content>.button-icon svg
236+
fill: #f44336
235237
</style>
236238

237239
<style lang="stylus" scoped>

src/components/BugReport.vue

+17-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@
2828
/>
2929
</VueFormField>
3030
</div>
31-
<div class="vue-ui-grid col-2 default-gap">
31+
<div
32+
:class="[
33+
'vue-ui-grid',
34+
'default-gap',
35+
attrs.scenes.name != 'H5' ? 'col-2' : '',
36+
]"
37+
>
3238
<VueFormField :title="i18n('nutui-repo-vue')">
3339
<VueTypeAhead
3440
v-model="attrs.versionVue"
@@ -40,7 +46,10 @@
4046
required
4147
/>
4248
</VueFormField>
43-
<VueFormField :title="i18n('nutui-repo-execution')">
49+
<VueFormField
50+
:title="i18n('nutui-repo-execution')"
51+
v-if="attrs.scenes.name != 'H5'"
52+
>
4453
<VueSelect
4554
v-model="attrs.runEnvVal"
4655
:label="attrs.runEnvVal.name"
@@ -334,7 +343,6 @@ export default {
334343
findNodejs() {},
335344
336345
generate() {
337-
console.log(this.attrs);
338346
const {
339347
scenes,
340348
version,
@@ -362,8 +370,14 @@ ${version}
362370
### Vue version(vue 版本)
363371
${versionVue}
364372
373+
${
374+
scenes.name != "H5"
375+
? `
365376
### Operating environment(运行环境)
366377
${runEnvVal.name}
378+
`
379+
: ""
380+
}
367381
368382
### Citation method(引用方式)
369383
${useWay.name}

vite.config.js

+27-16
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
11
import { createVuePlugin } from "vite-plugin-vue2";
2-
import { url } from "./src/helpers/env";
2+
import { defineConfig, loadEnv } from "vite";
3+
import config from "./package.json";
34

4-
export default {
5-
base: url.base,
6-
resolve: {
7-
alias: {
8-
"/images": "./src/assets/images",
5+
export default ({ mode }) => {
6+
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
7+
8+
return defineConfig({
9+
base: process.env.VITE_APP_BASE,
10+
resolve: {
11+
alias: {
12+
"/images": "./src/assets/images",
13+
},
914
},
10-
},
11-
plugins: [
12-
createVuePlugin(),
13-
{
14-
name: "load-raw-md",
15-
transform(code, id) {
16-
if (id.endsWith(".md")) {
17-
return `export default ${JSON.stringify(code)}`;
18-
}
15+
plugins: [
16+
createVuePlugin(),
17+
{
18+
name: "load-raw-md",
19+
transform(code, id) {
20+
if (id.endsWith(".md")) {
21+
return `export default ${JSON.stringify(code)}`;
22+
}
23+
},
1924
},
25+
],
26+
build: {
27+
target: "es2015",
28+
outDir: "./dist/nutui-issue-helper/",
29+
assetsDir: config.version,
30+
cssCodeSplit: true,
2031
},
21-
],
32+
});
2233
};

0 commit comments

Comments
 (0)