shmily1213 2 år sedan
förälder
incheckning
12509c6a8e
5 ändrade filer med 48 tillägg och 44 borttagningar
  1. 13 2
      babel.config.js
  2. 0 4
      package.json
  3. 28 27
      public/index.html
  4. 4 9
      src/main.js
  5. 3 2
      vue.config.js

+ 13 - 2
babel.config.js

@@ -1,8 +1,19 @@
 module.exports = {
+  // presets: [
+  //   // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
+  //   '@vue/cli-plugin-babel/preset'
+  // ],
   presets: [
-    // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
-    '@vue/cli-plugin-babel/preset'
+    ['@vue/app', {
+      polyfills: [
+        'es.promise',
+        'es.symbol',
+        'es.map',
+        'es.set'
+      ]
+    }]
   ],
+  compact: false,
   'env': {
     'development': {
       // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().

+ 0 - 4
package.json

@@ -36,7 +36,6 @@
     "url": "https://gitee.com/y_project/RuoYi-Vue.git"
   },
   "dependencies": {
-    "@babel/polyfill": "^7.12.1",
     "@riophae/vue-treeselect": "0.4.0",
     "ali-oss": "^6.16.0",
     "axios": "0.21.0",
@@ -45,7 +44,6 @@
     "docxtemplater": "^3.23.2",
     "echarts": "4.9.0",
     "element-ui": "2.15.0",
-    "es6-promise": "^4.2.8",
     "file-saver": "^2.0.4",
     "fuse.js": "6.4.3",
     "highlight.js": "9.18.5",
@@ -78,13 +76,11 @@
     "@vue/cli-plugin-babel": "4.4.6",
     "@vue/cli-plugin-eslint": "4.4.6",
     "@vue/cli-service": "4.4.6",
-    "babel-eslint": "10.1.0",
     "babel-plugin-macros": "^3.1.0",
     "babel-polyfill": "^6.26.0",
     "chalk": "4.1.0",
     "compression-webpack-plugin": "5.0.2",
     "connect": "3.6.6",
-    "es6-promise": "^4.2.8",
     "eslint": "7.15.0",
     "eslint-plugin-vue": "7.2.0",
     "lint-staged": "10.5.3",

+ 28 - 27
public/index.html

@@ -12,34 +12,35 @@
   </title>
   <!--[if lt IE 11]><script>window.location.href='html/ie.html';</script><![endif]-->
   <script>
-    // window.MathJax = {
-    //   tex: {
-    //     inlineMath: [
-    //       ["$", "$"],
-    //       ["\\(", "\\)"]
-    //     ],   //行内公式选择符
-    //     displayMath: [
-    //       ["$$", "$$"],
-    //       ["\\[", "\\]"]
-    //     ],   //段内公式选择符
-    //     autoload: {
-    //       color: [],
-    //       colorv2: ['color']
-    //     },
-    //     packages: { '[+]': ['noerrors', 'mathtools', 'ams'] }
-    //   },
-    //   options: {
-    //     skipHtmlTags: ["script", "noscript", "style", "textarea", "pre", "code", "a"],   //避开某些标签
-    //     ignoreHtmlClass: 'tex2jax_ignore',
-    //     processHtmlClass: 'tex2jax_process'
-    //   },
-    //   loader: {
-    //     load: ['input/asciimath', '[tex]/noerrors', '[tex]/mathtools', '[tex]/ams']
-    //   }
-    // };
+    window.MathJax = {
+      tex: {
+        inlineMath: [
+          ["$", "$"],
+          ["\\(", "\\)"]
+        ],   //行内公式选择符
+        displayMath: [
+          ["$$", "$$"],
+          ["\\[", "\\]"]
+        ],   //段内公式选择符
+        autoload: {
+          color: [],
+          colorv2: ['color']
+        },
+        packages: { '[+]': ['noerrors', 'mathtools', 'ams'] }
+      },
+      options: {
+        skipHtmlTags: ["script", "noscript", "style", "textarea", "pre", "code", "a"],   //避开某些标签
+        ignoreHtmlClass: 'tex2jax_ignore',
+        processHtmlClass: 'tex2jax_process'
+      },
+      loader: {
+        load: ['input/asciimath', '[tex]/noerrors', '[tex]/mathtools', '[tex]/ams']
+      }
+    };
   </script>
-  <!-- <script async src="https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/MathJaxFiles/3.2.0/es5/tex-svg-full.js"
-    id="MathJax-script"></script> -->
+  <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+  <script async src="https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/MathJaxFiles/3.2.0/es5/tex-svg-full.js"
+    id="MathJax-script"></script>
   <!-- <script src="//cdn.bootcss.com/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
 	 <link rel="dns-prefetch" href="//cdn.mathjax.org" /> -->
   <style>

+ 4 - 9
src/main.js

@@ -1,8 +1,3 @@
-import '@babel/polyfill'
-import Es6Promise from 'es6-promise'
-require('es6-promise').polyfill()
-Es6Promise.polyfill()
-
 import Vue from 'vue'
 
 // use code below to debug in mobile devices.
@@ -111,12 +106,12 @@ Vue.component('ImageUpload', ImageUpload) // OSS文件上传
 Vue.use(permission)
 
 // vue-video-player
-import VideoPlayer from 'vue-video-player'
-require('video.js/dist/video-js.css')
-require('vue-video-player/src/custom-theme.css')
+// import VideoPlayer from 'vue-video-player'
+// require('video.js/dist/video-js.css')
+// require('vue-video-player/src/custom-theme.css')
 const hls = require('videojs-contrib-hls')
 Vue.use(hls)
-Vue.use(VideoPlayer)
+// Vue.use(VideoPlayer)
 
 /**
  * If you don't want to use mock-server

+ 3 - 2
vue.config.js

@@ -57,6 +57,7 @@ module.exports = {
     disableHostCheck: true,
     // before: require('./mock/mock-server.js')
   },
+  transpileDependencies: ['element-ui', 'axios'],
   configureWebpack: {
     name: name,
     resolve: {
@@ -74,8 +75,8 @@ module.exports = {
     ],
   },
   chainWebpack(config) {
-    config.plugins.delete('preload') // TODO: need test
-    config.plugins.delete('prefetch') // TODO: need test
+    config.entry('main').add('babel-polyfill')
+    config.entry.app = ['babel-polyfill', './src/main.js']
     // set svg-sprite-loader
     config.module
       .rule('svg')