Browse Source

构建打包

tangjinzhou 6 years ago
parent
commit
923146e957
4 changed files with 15 additions and 2 deletions
  1. 1 0
      src/App.vue
  2. 4 1
      src/components/Chart.vue
  3. 3 0
      src/icons.js
  4. 7 1
      vue.config.js

+ 1 - 0
src/App.vue

@@ -9,6 +9,7 @@
 import zhCN from "ant-design-vue/lib/locale-provider/zh_CN";
 import enUS from "ant-design-vue/lib/locale-provider/en_US";
 import moment from "moment";
+import "moment/locale/zh-cn";
 export default {
   data() {
     return {

+ 4 - 1
src/components/Chart.vue

@@ -3,7 +3,10 @@
 </template>
 
 <script>
-import echarts from "echarts";
+import echarts from "echarts/lib/echarts";
+import "echarts/lib/chart/bar";
+import "echarts/lib/component/title";
+
 import debounce from "lodash/debounce";
 import { addListener, removeListener } from "resize-detector";
 export default {

+ 3 - 0
src/icons.js

@@ -0,0 +1,3 @@
+export {
+  default as SettingOutline
+} from "@ant-design/icons/lib/outline/SettingOutline";

+ 7 - 1
vue.config.js

@@ -1,4 +1,5 @@
 const path = require("path");
+const webpack = require("webpack");
 const AntDesignThemePlugin = require("antd-theme-webpack-plugin");
 
 const options = {
@@ -26,7 +27,12 @@ module.exports = {
     }
   },
   configureWebpack: {
-    plugins: [themePlugin]
+    plugins: [themePlugin, new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)],
+    resolve: {
+      alias: {
+        "@ant-design/icons/lib/dist$": path.resolve(__dirname, "./src/icons.js")
+      }
+    }
   },
   chainWebpack: config => {
     const svgRule = config.module.rule("svg");