lizw 3 jaren geleden
bovenliggende
commit
bfc609c0d2
4 gewijzigde bestanden met toevoegingen van 5 en 14 verwijderingen
  1. 1 1
      src/App.vue
  2. 0 5
      src/module_1.js
  3. 0 6
      src/module_2.js
  4. 4 2
      vite.config.js

+ 1 - 1
src/App.vue

@@ -7,7 +7,7 @@
 </template>
 
 <script>
-import Header from '@/components/Header/index.vue'
+import Header from './component/Header'
 export default {
   data() {
     return {

+ 0 - 5
src/module_1.js

@@ -1,5 +0,0 @@
-const fun_a = (a, b) => a + b;
-
-export {
-  fun_a,
-}

+ 0 - 6
src/module_2.js

@@ -1,6 +0,0 @@
-const value_b = {
-  num: 123,
-  str: "测试"
-}
-
-export default value_b;

+ 4 - 2
vite.config.js

@@ -2,6 +2,7 @@ import { defineConfig } from "vite";
 import vue from '@vitejs/plugin-vue'
 import legacy from "@vitejs/plugin-legacy";
 import vitePluginImp from "vite-plugin-imp";
+
 const path = require("path");
 
 // https://vitejs.dev/config/
@@ -30,7 +31,9 @@ export default defineConfig({
       "~": path.resolve(__dirname, "./"),
       "@": path.resolve(__dirname, "./src/"),
     },
+    extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
   },
+
   css: {
     preprocessorOptions: {
       less: {
@@ -72,8 +75,7 @@ export default defineConfig({
     cssCodeSplit: true,
     rollupOptions: {
       external: [],
-      plugins: [
-      ],
+      plugins: [],
       output: {
         // name: name,
         // exports: 'named',