Browse Source

chore: build taro h5 html

suzigang 3 years ago
parent
commit
3905910847

+ 1 - 1
src/packages/styles/theme-deafult.scss

@@ -632,7 +632,7 @@ page {
   --nut-indicator-white: var(--nut-white);
   --nut-indicator-size: 18px;
   --nut-indicator-dot-size: calc(var(--nut-indicator-size) / 3);
-  --nut-indicator-border-size: calc(var(--nut-indicator-size)+ 2);
+  --nut-indicator-border-size: calc(var(--nut-indicator-size) + 2px);
   --nut-indicator-number-font-size: 10px;
 
   // menu

+ 1 - 1
src/packages/styles/theme-jdt.scss

@@ -610,7 +610,7 @@ page {
   --nut-indicator-white: var(--nut-white);
   --nut-indicator-size: 18px;
   --nut-indicator-dot-size: calc(var(--nut-indicator-size) / 3);
-  --nut-indicator-border-size: calc(var(--nut-indicator-size)+ 2);
+  --nut-indicator-border-size: calc(var(--nut-indicator-size) + 2px);
   --nut-indicator-number-font-size: 10px;
 
   // menu

+ 2 - 1
src/sites/mobile-taro/vue/config/index.js

@@ -13,7 +13,7 @@ const config = {
   outputRoot: 'dist',
   plugins: ['@tarojs/plugin-html'],
   alias: {
-    // '@vue': path.resolve(__dirname, '../../../../../node_modules/@vue'),
+    '@vue': path.resolve(__dirname, '../../../../../node_modules/@vue'),
     '@/packages': path.resolve(__dirname, '../../../../../src/packages')
   },
   sass: {
@@ -50,6 +50,7 @@ const config = {
   h5: {
     publicPath: '/',
     staticDirectory: 'static',
+    chunkDirectory: 'chunk',
     postcss: {
       autoprefixer: {
         enable: true,

+ 2 - 0
src/sites/mobile-taro/vue/config/prod.js

@@ -1,3 +1,4 @@
+const path = require('path');
 module.exports = {
   env: {
     NODE_ENV: '"production"'
@@ -5,6 +6,7 @@ module.exports = {
   defineConstants: {},
   mini: {},
   h5: {
+    publicPath: '/vue_taro/demo/'
     /**
      * 如果h5端编译后体积过大,可以使用webpack-bundle-analyzer插件对打包体积进行分析。
      * 参考代码如下:

+ 21 - 16
src/sites/mobile-taro/vue/src/index.html

@@ -1,19 +1,24 @@
 <!DOCTYPE html>
 <html>
-<head>
-  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
-  <meta content="width=device-width,initial-scale=1,user-scalable=no,viewport-fit=cover" name="viewport">
-  <meta name="apple-mobile-web-app-capable" content="yes">
-  <meta name="apple-touch-fullscreen" content="yes">
-  <meta name="format-detection" content="telephone=no,address=no">
-  <meta name="apple-mobile-web-app-status-bar-style" content="white">
-  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
-  <title></title>
-  <script>
-    !function(x){function w(){var v,u,t,tes,s=x.document,r=s.documentElement,a=r.getBoundingClientRect().width;if(!v&&!u){var n=!!x.navigator.appVersion.match(/AppleWebKit.*Mobile.*/);v=x.devicePixelRatio;tes=x.devicePixelRatio;v=n?v:1,u=1/v}if(a>=640){r.style.fontSize="40px"}else{if(a<=320){r.style.fontSize="20px"}else{r.style.fontSize=a/320*20+"px"}}}x.addEventListener("resize",function(){w()});w()}(window);
+
+  <head>
+    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+    <meta
+      content="width=device-width,initial-scale=1,user-scalable=no,viewport-fit=cover"
+      name="viewport">
+    <meta name="apple-mobile-web-app-capable" content="yes">
+    <meta name="apple-touch-fullscreen" content="yes">
+    <meta name="format-detection" content="telephone=no,address=no">
+    <meta name="apple-mobile-web-app-status-bar-style" content="white">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <title></title>
+    <script>
+    !function (x) { function w() { var v, u, t, tes, s = x.document, r = s.documentElement, a = r.getBoundingClientRect().width; if (!v && !u) { var n = !!x.navigator.appVersion.match(/AppleWebKit.*Mobile.*/); v = x.devicePixelRatio; tes = x.devicePixelRatio; v = n ? v : 1, u = 1 / v } if (a >= 640) { r.style.fontSize = "40px" } else { if (a <= 320) { r.style.fontSize = "20px" } else { r.style.fontSize = 20 + "px" } } } x.addEventListener("resize", function () { w() }); w() }(window);
   </script>
-</head>
-<body>
-  <div id="app"></div>
-</body>
-</html>
+  </head>
+
+  <body>
+    <div id="app"></div>
+  </body>
+
+</html>