Skip to content

Commit

Permalink
rsbuild vue2 (#34)
Browse files Browse the repository at this point in the history
* rsbuild vue2

* Refactor proxy configuration in rsbuild.config.js to simplify API endpoint mapping

* Update server port configuration in rsbuild.config.js
  • Loading branch information
swuecho authored Aug 30, 2024
1 parent ece967e commit 837bfa5
Show file tree
Hide file tree
Showing 8 changed files with 948 additions and 7,654 deletions.
16 changes: 9 additions & 7 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"name": "qa-editor",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
"serve": "rsbuild dev",
"build": "rsbuild build"
},
"resolutions": {
"prosemirror-model": "1.13.1"
Expand All @@ -29,13 +29,15 @@
"@iconify/icons-material-symbols": "^1.2.40",
"@iconify/icons-mdi": "^1.2.45",
"@iconify/vue2": "^2.1.0",
"@vue/cli-plugin-babel": "^4.5.10",
"@vue/cli-plugin-eslint": "^4.5.10",
"@vue/cli-service": "^4.5.10",
"@rsbuild/core": "^1.0.1-rc.0",
"@rsbuild/plugin-less": "^1.0.1-rc.0",
"@rsbuild/plugin-vue2": "^1.0.1-rc.0",
"autoprefixer": "^10.4.20",
"babel-eslint": "^10.0.1",
"eslint": "^5.15.1",
"eslint-plugin-vue": "^6.2.2",
"vue-cli-plugin-axios": "^0.0.4",
"postcss": "^8.4.41",
"tailwindcss": "^3.4.10",
"vue-template-compiler": "^2.7.14"
},
"eslintConfig": {
Expand Down
5 changes: 4 additions & 1 deletion web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="icon" href="<%= assetPrefix %>/favicon.ico">



<!--
<link rel="stylesheet" href="/assets/static/css/highlightjs/default.min.css">
<script src="/assets/static/js/highlightjs/highlight.min.js"></script>
Expand Down
36 changes: 36 additions & 0 deletions web/rsbuild.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { defineConfig } from '@rsbuild/core';
import { pluginVue2 } from '@rsbuild/plugin-vue2';

import { pluginLess } from "@rsbuild/plugin-less";

export default defineConfig({
html: {
template: './public/index.html',
},
source: {
entry: {
index: './src/main.js',
},
},
output: {
distPath: {
root: '../api/wwwroot/',
}
},
plugins: [
pluginVue2(),
pluginLess(),
],
server: {
open: process.platform === 'darwin',
host: '0.0.0.0',
port: 9099,
https: false,
hotOnly: false,
proxy: {
"/api": {
target: "http://localhost:5000",
}
},
},
})
1 change: 0 additions & 1 deletion web/src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Vue.use(Router)

export default new Router({
mode: 'history',
base: process.env.BASE_URL,
routes: [{
path: '/',
name: 'home',
Expand Down
2 changes: 1 addition & 1 deletion web/src/views/Diary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script>
import EditorWrapper from "@/views/EditorWrapper";
import EditorWrapper from "./EditorWrapper";
export default {
date() {
Expand Down
4 changes: 2 additions & 2 deletions web/src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
</template>

<script>
import EditorWrapper from "@/views/EditorWrapper";
import { get_date_of_today } from "@/util.js";
import EditorWrapper from "./EditorWrapper";
import { get_date_of_today } from "../util.js";
export default {
date() {
Expand Down
22 changes: 0 additions & 22 deletions web/vue.config.js

This file was deleted.

Loading

0 comments on commit 837bfa5

Please sign in to comment.