Преглед изворни кода

:sparkles: wave-ui working with tree shaking

tags/0.0.1
J пре 3 година
родитељ
комит
9092c03a55

+ 247
- 2016
frontend/package-lock.json
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 2
- 7
frontend/package.json Прегледај датотеку

22
         "@prettier/plugin-pug": "^1.19.2",
22
         "@prettier/plugin-pug": "^1.19.2",
23
         "@vitejs/plugin-vue": "^2.2.4",
23
         "@vitejs/plugin-vue": "^2.2.4",
24
         "@vue/compiler-sfc": "^3.2.31",
24
         "@vue/compiler-sfc": "^3.2.31",
25
-        "autoprefixer": "^10.4.2",
26
         "cross-env": "^7.0.3",
25
         "cross-env": "^7.0.3",
27
         "eslint": "^8.11.0",
26
         "eslint": "^8.11.0",
28
         "eslint-config-prettier": "^8.5.0",
27
         "eslint-config-prettier": "^8.5.0",
29
         "eslint-plugin-vue": "^8.5.0",
28
         "eslint-plugin-vue": "^8.5.0",
30
-        "naive-ui": "^2.26.4",
31
-        "postcss": "^8.4.8",
32
-        "postcss-calc": "^8.2.4",
33
-        "postcss-import": "^14.0.2",
34
-        "precss": "^4.0.0",
35
         "pug": "^3.0.2",
29
         "pug": "^3.0.2",
36
         "pug-plain-loader": "^1.1.0",
30
         "pug-plain-loader": "^1.1.0",
37
-        "sugarss": "^4.0.1",
31
+        "sass": "^1.54.4",
32
+        "sass-loader": "^10.3.1",
38
         "vite": "^2.8.6",
33
         "vite": "^2.8.6",
39
         "vite-fs": "^0.0.2",
34
         "vite-fs": "^0.0.2",
40
         "watch": "^1.0.2"
35
         "watch": "^1.0.2"

+ 0
- 9
frontend/postcss.config.js Прегледај датотеку

1
-module.exports = {
2
-    parser: 'sugarss',
3
-    plugins: [
4
-        require('postcss-import'),
5
-        require('postcss-calc'),
6
-        require('precss'),
7
-        require('autoprefixer'),
8
-    ],
9
-}

+ 2
- 2
frontend/src/App.vue Прегледај датотеку

3
     w-badge
3
     w-badge
4
         template(#badge) 3
4
         template(#badge) 3
5
             w-button(color="primary")
5
             w-button(color="primary")
6
-                w-icon(class="mr1") mdi mdi-email
7
-                    Emails
6
+                w-icon(class="mr1") mdi mdi-email Emails
8
     w-flex.my12(:gap="3" align-center wrap)
7
     w-flex.my12(:gap="3" align-center wrap)
9
         | Show menu on:
8
         | Show menu on:
10
         w-menu
9
         w-menu
25
 </template>
24
 </template>
26
 
25
 
27
 <script>
26
 <script>
27
+import 'wave-ui/dist/wave-ui.css'
28
 import SideBar from './components/SideBar.vue'
28
 import SideBar from './components/SideBar.vue'
29
 
29
 
30
 import { Chatter, currentProfile, StonkAlert } from './services'
30
 import { Chatter, currentProfile, StonkAlert } from './services'

+ 9
- 5
frontend/src/main.js Прегледај датотеку

2
 import router from './router'
2
 import router from './router'
3
 import { checkLoginStatus } from './router/guards'
3
 import { checkLoginStatus } from './router/guards'
4
 
4
 
5
-import WaveUI from 'wave-ui'
5
+import WaveUI from '../node_modules/wave-ui/src/wave-ui/core'
6
+import components from './wave'
6
 
7
 
7
 import App from './App.vue'
8
 import App from './App.vue'
8
 import MainNav from './components/MainNav.vue'
9
 import MainNav from './components/MainNav.vue'
15
 router.beforeEach((to, from, next) => {
16
 router.beforeEach((to, from, next) => {
16
     /**
17
     /**
17
      * Skip any route guarding with `npm run dev` or
18
      * Skip any route guarding with `npm run dev` or
18
-     * use the loginService to deal with login details
19
-     * Activate with `npm run nodev`
19
+     * Use the loginService to deal with login details
20
+     * NOTE: Activate with `npm run nodev`
20
      */
21
      */
21
     if (DEV) {
22
     if (DEV) {
22
         next()
23
         next()
26
 })
27
 })
27
 
28
 
28
 const run = entry => {
29
 const run = entry => {
29
-    const siimee = createApp(App).use(router)
30
-    new WaveUI(siimee, {})
30
+    const siimee = createApp(App)
31
+    siimee.use(WaveUI, { components })
32
+    new WaveUI(siimee)
33
+
34
+    siimee.use(router)
31
     siimee.component('MainNav', MainNav)
35
     siimee.component('MainNav', MainNav)
32
     siimee.mount(entry)
36
     siimee.mount(entry)
33
 }
37
 }

+ 2
- 1
frontend/src/views/SurveyView.vue Прегледај датотеку

74
 export default {
74
 export default {
75
     props: {
75
     props: {
76
         pid: {
76
         pid: {
77
-            type: Number,
77
+            type: String,
78
+            default: () => '1',
78
         },
79
         },
79
     },
80
     },
80
     data() {
81
     data() {

+ 28
- 0
frontend/src/wave.js Прегледај датотеку

1
+/**
2
+ * We have to destructure the import for tree-shaking to work
3
+ */
4
+import {
5
+    WAlert,
6
+    WApp,
7
+    WBadge,
8
+    WButton,
9
+    WCard,
10
+    WFlex,
11
+    WIcon,
12
+    WImage,
13
+    WMenu,
14
+    WOverlay,
15
+} from '../node_modules/wave-ui/src/wave-ui/components'
16
+
17
+export default {
18
+    WAlert,
19
+    WApp,
20
+    WBadge,
21
+    WButton,
22
+    WCard,
23
+    WFlex,
24
+    WIcon,
25
+    WImage,
26
+    WMenu,
27
+    WOverlay,
28
+}

+ 10
- 2
frontend/vite.config.js Прегледај датотеку

1
 import { defineConfig } from 'vite'
1
 import { defineConfig } from 'vite'
2
 import vue from '@vitejs/plugin-vue'
2
 import vue from '@vitejs/plugin-vue'
3
-import ViteFS from 'vite-fs'
3
+
4
 // https://vitejs.dev/config/
4
 // https://vitejs.dev/config/
5
 export default defineConfig({
5
 export default defineConfig({
6
-    plugins: [vue(), ViteFS()],
6
+    css: {
7
+        preprocessorOptions: {
8
+            scss: {
9
+                additionalData:
10
+                    '$use-layout-classes: false;@import "/src/../node_modules/wave-ui/src/wave-ui/scss/_variables.scss";',
11
+            },
12
+        },
13
+    },
14
+    plugins: [vue()],
7
     resolve: {
15
     resolve: {
8
         alias: {
16
         alias: {
9
             '@': require('path').resolve(__dirname, 'src'),
17
             '@': require('path').resolve(__dirname, 'src'),

Loading…
Откажи
Сачувај