2 files deleted
2 files added
7 files modified
New file |
| | |
| | | { |
| | | "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" |
| | | ] |
| | | } |
| | |
| | | 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/' |
| | | } |
| | | }];; |
| | | }]; |
| | |
| | | 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]', |
| | |
| | | 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({ |
| | |
| | | }) |
| | | ]; |
| | | |
| | | 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"] |
| | |
| | | rules |
| | | }, |
| | | devServer: { |
| | | contentBase: './dist-debug', |
| | | contentBase: "./dist-debug", |
| | | hot: true |
| | | }, |
| | | mode: 'development', |
| | | devtool: 'inline-source-map', |
| | | mode: "development", |
| | | devtool: "inline-source-map", |
| | | plugins |
| | | }; |
| | |
| | | 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)); |
| | |
| | | function indexSass(view, args) { |
| | | return [ |
| | | hicode(args), |
| | | `@import '../../conf/vars';`, |
| | | // `@import '../../conf/vars';`, |
| | | ``, |
| | | `.${kebabCase(view)} {`, |
| | | ` &-main {`, |
New file |
| | |
| | | { |
| | | "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" |
| | | ] |
| | | } |
| | |
| | | { |
| | | "name": "byfy", |
| | | "name": "ByfyYfzt", |
| | | "description": "白云法院前端项目", |
| | | "scripts": { |
| | | "code": "node ./.command/code", |
| | |
| | | "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" |
| | | } |
| | | } |