vue3+vite import jquery bootstrap popper build error

217 views Asked by At

when I run npm install dev, following error info; enter image description here

when I run npm install build , following error info and web is blank; enter image description here

following is a part of code

// index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <link rel="icon" href="/favicon.ico">
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      <!-- Page Title -->
      <title>Test</title>
      <!-- / -->
      <!---Font Icon-->
      <link href="src/assets/css/fontawesome-all.min.css" rel="stylesheet">
      <link href="src/assets/css/themify-icons.css" rel="stylesheet">
      <!-- / -->
      <!-- Plugin CSS -->
      <link href="src/assets/css/bootstrap.min.css" rel="stylesheet">
      <link href="src/assets/css/owl.carousel.min.css" rel="stylesheet">
      <link href="src/assets/css/magnific-popup.css" rel="stylesheet">
      <!-- / -->
      <!-- Theme Style -->
      <link href="src/assets/css/styles.css" rel="stylesheet">
      <link href="src/assets/css/default.css" rel="stylesheet" id="color_theme">
      <!-- / -->
      <!-- Favicon -->
      <!-- / -->

      <!-- jQuery -->
      <script type="module"  src="src/assets/js/jquery-3.2.1.min.js"></script>
      <script type="module"  src="src/assets/js/jquery-migrate-3.0.0.min.js"></script>
      <!-- Plugins -->
      <script type="module"  src="src/assets/js/popper.min.js"></script>
      <script type="module"  src="src/assets/js/bootstrap.min.js"></script>
      <script type="module"  src="src/assets/js/owl.carousel.min.js"></script>
      <script type="module"  src="src/assets/js/jquery.magnific-popup.min.js"></script>
      <script type="module"  src="src/assets/js/particles.min.js"></script>
      <script type="module"  src="src/assets/js/particles-app.js"></script>
      <!-- custom -->
      <script type="module"  src="src/assets/js/custom.js"></script>
  </head>
  <body>
    <div id="app"></div>
    <script type="module" src="/src/main.js"></script>
  </body>
</html>

//vite.config.js
import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  }
})

this is project structure enter image description here

how can i fix this questionyour text

1

There are 1 answers

0
GaryMK On BEST ANSWER

I finally solved this problem by replacing particles.min.js with particle.vue