forked from nsjcy/frontEnd/nsjcy

LAPTOP-RI7D261L\Mr Ke
2020-02-04 8a42987cbc94722ab24f805925b5922a1af4b217
修改
2 files deleted
2 files added
7 files modified
385 ■■■■■ changed files
.babelrc 42 ●●●●● patch | view | raw | blame | history
.command/.conf/rules.js 4 ●●●● patch | view | raw | blame | history
.command/.conf/webpack.dist.js 2 ●●● patch | view | raw | blame | history
.command/.conf/webpack.test.js 91 ●●●● patch | view | raw | blame | history
.command/.gitignore 2 ●●● patch | view | raw | blame | history
.command/code/index.js 2 ●●● patch | view | raw | blame | history
.command/code/view/content.js 2 ●●● patch | view | raw | blame | history
.command/webpack.dist.js 95 ●●●●● patch | view | raw | blame | history
.command/webpack.test.js 74 ●●●●● patch | view | raw | blame | history
babelrc 42 ●●●●● patch | view | raw | blame | history
package.json 29 ●●●●● patch | view | raw | blame | history
.babelrc
New file
@@ -0,0 +1,42 @@
{
  "presets": [
    [
      "env",
      {
        "targets": {
          "browsers": [
            "last 2 version",
            "last 2 years"
          ]
        }
      }
    ],
    "react",
    "stage-0"
  ],
  "plugins": [
    [
      "import",
      [
        {
          "libraryName": "antd",
          "style": "css"
        },
        {
          "libraryName": "antd-mobile",
          "style": "css"
        }
      ]
    ],
    [
      "transform-runtime",
      {
        "helpers": false,
        "polyfill": false,
        "regenerator": true,
        "moduleName": "babel-runtime"
      }
    ],
    "imext"
  ]
}
.command/.conf/rules.js
@@ -13,10 +13,10 @@
  test: /\.less$/i,
  use: [MiniCssExtractPlugin.loader, 'css-loader', 'less-loader']
}, {
  test: /\.(svg|png|jpg|gif)$/i,
  test: /\.(svg|png|jpg|gif|mp4|ttf)$/i,
  loader: 'file-loader',
  options: {
    name: '[name].[ext]?[hash]',
    outputPath: 'static/'
  }
}];;
}];
.command/.conf/webpack.dist.js
@@ -15,7 +15,7 @@
  test: /\.s[ac]ss$/i,
  use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader']
}, {
  test: /\.(svg|png|jpg|gif)$/i,
  test: /\.(svg|png|jpg|gif|ttf)$/i,
  loader: 'file-loader',
  options: {
    name: '[name].[ext]?[hash]',
.command/.conf/webpack.test.js
@@ -1,37 +1,41 @@
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const webpack = require('webpack');
const path = require('path');
const fs = require('fs');
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const webpack = require("webpack");
const path = require("path");
const fs = require("fs");
const rules = [{
  test: /\.(js|jsx)$/i,
  loader: 'babel-loader'
}, {
  test: /\.css$/i,
  use: [MiniCssExtractPlugin.loader, 'css-loader']
}, {
  test: /\.s[ac]ss$/i,
  use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader']
}, {
  test: /\.less$/i,
  use: [MiniCssExtractPlugin.loader, 'css-loader', 'less-loader']
}, {
  test: /\.(svg|png|jpg|gif)$/i,
  loader: 'file-loader',
  options: {
    name: '[name].[ext]?[hash]',
    outputPath: 'static/'
const rules = [
  {
    test: /\.(js|jsx)$/i,
    loader: "babel-loader"
  },
  {
    test: /\.css$/i,
    use: [MiniCssExtractPlugin.loader, "css-loader"]
  },
  {
    test: /\.s[ac]ss$/i,
    use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"]
  },
  {
    test: /\.less$/i,
    use: [MiniCssExtractPlugin.loader, "css-loader", "less-loader"]
  },
  {
    test: /\.(svg|png|jpg|gif|ttf)$/i,
    loader: "file-loader",
    options: {
      name: "[name].[ext]?[hash]",
      outputPath: "static/"
    }
  }
}];
];
const plugins = [
  new webpack.HotModuleReplacementPlugin(),
  new HtmlWebpackPlugin({
    template: './src/conf/index.html',
    template: "./src/conf/index.html",
    minify: true
  }),
  new MiniCssExtractPlugin({
@@ -39,24 +43,23 @@
  })
];
if (fs.existsSync(path.resolve(__dirname, './src/copy'))) {
  plugins.push(new CopyWebpackPlugin([{
    to: path.resolve(__dirname, './dist-debug'),
    from: './src/copy',
    toType: 'dir'
  }]));
if (fs.existsSync(path.resolve(__dirname, "./src/copy"))) {
  plugins.push(
    new CopyWebpackPlugin([
      {
        to: path.resolve(__dirname, "./dist-debug"),
        from: "./src/copy",
        toType: "dir"
      }
    ])
  );
}
module.exports = {
  entry: [
    './src/conf/reset.scss',
    './src/index.jsx',
    './src/conf/cover.scss'
  ],
  entry: ["./src/conf/reset.scss", "./src/index.jsx", "./src/conf/cover.scss"],
  output: {
    path: path.resolve(__dirname, './dist-debug'),
    filename: 'index.js?[hash]'
    path: path.resolve(__dirname, "./dist-debug"),
    filename: "index.js?[hash]"
  },
  resolve: {
    extensions: [".js", ".jsx", ".ts", ".tsx"]
@@ -65,10 +68,10 @@
    rules
  },
  devServer: {
    contentBase: './dist-debug',
    contentBase: "./dist-debug",
    hot: true
  },
  mode: 'development',
  devtool: 'inline-source-map',
  mode: "development",
  devtool: "inline-source-map",
  plugins
};
.command/.gitignore
@@ -1 +1 @@
!.command/dist
.command/code/index.js
@@ -7,7 +7,7 @@
const program = process.argv.slice(2);
if (['component', 'components', 'view', 'views'].includes(path.basename(base))) {
if (['component', 'components', 'comp', 'view', 'views'].includes(path.basename(base))) {
  require('./view')(base, program[0], program.slice(1));
} else if (path.basename(base) === 'page') {
  require('./page')(base, program[0], program.slice(1));
.command/code/view/content.js
@@ -46,7 +46,7 @@
function indexSass(view, args) {
  return [
    hicode(args),
    `@import '../../conf/vars';`,
    // `@import '../../conf/vars';`,
    ``,
    `.${kebabCase(view)} {`,
    `  &-main {`,
.command/webpack.dist.js
File was deleted
.command/webpack.test.js
File was deleted
babelrc
New file
@@ -0,0 +1,42 @@
{
  "presets": [
    [
      "env",
      {
        "targets": {
          "browsers": [
            "last 2 version",
            "last 2 years"
          ]
        }
      }
    ],
    "react",
    "stage-0"
  ],
  "plugins": [
    [
      "import",
      [
        {
          "libraryName": "antd",
          "style": "css"
        },
        {
          "libraryName": "antd-mobile",
          "style": "css"
        }
      ]
    ],
    [
      "transform-runtime",
      {
        "helpers": false,
        "polyfill": false,
        "regenerator": true,
        "moduleName": "babel-runtime"
      }
    ],
    "imext"
  ]
}
package.json
@@ -1,5 +1,5 @@
{
  "name": "byfy",
  "name": "ByfyYfzt",
  "description": "白云法院前端项目",
  "scripts": {
    "code": "node ./.command/code",
@@ -21,35 +21,46 @@
    "copy-webpack-plugin": "^4.5.1",
    "cross-env": "^5.1.5",
    "css-loader": "^0.28.11",
    "es6-promise": "^4.2.5",
    "file-loader": "^1.1.11",
    "html-webpack-plugin": "^3.2.0",
    "isomorphic-fetch": "^2.2.1",
    "less": "^3.0.4",
    "less-loader": "^4.1.0",
    "mini-css-extract-plugin": "^0.4.0",
    "node-sass": "^4.9.0",
    "react-sticky": "^6.0.3",
    "sass-loader": "^7.0.1",
    "style-loader": "^0.21.0",
    "webpack": "^4.8.3",
    "webpack-cli": "^2.1.3",
    "webpack-dev-server": "^3.1.4"
    "webpack-dev-server": "3.1.10"
  },
  "license": "ISC",
  "dependencies": {
    "antd": "^3.5.2",
    "antd": "^3.10.8",
    "antd-mobile": "2.1.6",
    "babel-polyfill": "^6.26.0",
    "babel-runtime": "^6.26.0",
    "braft-editor": "^2.1.22",
    "braft-editor": "^2.3.8",
    "classnames": "^2.2.5",
    "echarts": "^4.1.0",
    "hife": "^1.0.10",
    "define-properties": "^1.1.3",
    "echarts": "^4.2.1",
    "extract-text-webpack-plugin": "^3.0.2",
    "hife": "1.0.10",
    "less-vars-to-js": "^1.3.0",
    "lodash": "^4.17.10",
    "moment": "^2.22.1",
    "react": "16.3.2",
    "react": "^16.3.2",
    "react-amap": "^1.2.7",
    "react-bmap": "^1.0.74",
    "react-dom": "^16.3.2",
    "react-router": "^4.2.0",
    "react-router-dom": "^4.2.2",
    "simditor": "^2.3.19",
    "simditor-html": "^1.1.1",
    "react-sticky": "^6.0.3",
    "reqwest": "^2.0.5",
    "styled-components": "^4.1.3",
    "swiper": "^4.4.6",
    "weixin-js-sdk": "^1.3.2"
  }
}