Commit bfc3b458 authored by 邓晓峰's avatar 邓晓峰

fix: 修复esm编译

parent 71455426
Pipeline #48575 skipped with stages
......@@ -5,7 +5,7 @@ PROXY=/Cityinterface:http://192.168.12.116:8015;/PandaOMS:http://192.168.12.116:
# PROXY2 = test : http://localhost:8006/
# 本地应用启动的host域名
HOST = 192.168.12.192
HOST = 127.0.0.1
# 本地应用启动的端口
PORT = 3001
......@@ -3,16 +3,39 @@ module.exports = {
[
'@babel/preset-env',
{
modules: false,
'exclude': [
'transform-typeof-symbol',
'transform-unicode-regex',
'transform-sticky-regex',
'transform-new-target',
'transform-modules-umd',
'transform-modules-systemjs',
'transform-modules-amd',
'transform-literals',
],
'modules': false,
},
],
'@babel/preset-react',
['@babel/preset-typescript'],
['@babel/preset-react'],
],
plugins: [
'styled-components',
'@babel/plugin-proposal-class-properties',
['@babel/plugin-proposal-optional-chaining', { 'loose': false }],
['@babel/plugin-proposal-nullish-coalescing-operator', { 'loose': false }],
'@babel/plugin-syntax-top-level-await',
['@babel/plugin-transform-destructuring', { 'loose': false }],
['@babel/plugin-proposal-decorators', { 'legacy': true }],
['@babel/plugin-proposal-class-properties', { 'loose': true }],
'@babel/plugin-proposal-export-default-from',
['@babel/plugin-proposal-pipeline-operator', { 'proposal': 'minimal' }],
'@babel/plugin-proposal-do-expressions',
'@babel/plugin-proposal-function-bind',
'@babel/plugin-proposal-logical-assignment-operators',
'@babel/plugin-syntax-dynamic-import',
['import', { libraryName: 'antd', style: true }],
['babel-plugin-transform-react-remove-prop-types', { 'removeImport': true }],
['babel-plugin-react-require'],
['babel-plugin-import', { 'libraryName': 'antd', 'libraryDirectory': 'es', 'style': true }, 'antd'],
],
env: {
production: {
......@@ -21,14 +44,14 @@ module.exports = {
'lodash',
'transform-react-remove-prop-types',
'@babel/plugin-transform-react-inline-elements',
'@babel/plugin-transform-react-constant-elements',
'@babel/plugin-transform-react-constant-elements'
],
},
development: {
plugins: ['react-refresh/babel']
},
test: {
plugins: [
'@babel/plugin-transform-modules-commonjs',
'dynamic-import-node',
],
plugins: ['@babel/plugin-transform-modules-commonjs', 'dynamic-import-node']
},
},
};
......@@ -3,6 +3,8 @@ const webpack = require('webpack');
const slash = require('slash2');
const CopyPlugin = require('copy-webpack-plugin');
const cesiumSource = './node_modules/cesium/Build/Cesium';
const FastRefreshPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const nodeLibs = require('node-libs-browser');
console.log();
module.exports = options => ({
mode: options.mode,
......@@ -22,10 +24,6 @@ module.exports = options => ({
// 允许Cesium兼容 webpack的require方式
toUrlUndefined: true,
},
node: {
// 解决fs模块的问题(Resolve node module use of fs)
fs: 'empty',
},
module: {
rules: [
{
......@@ -33,11 +31,11 @@ module.exports = options => ({
exclude: /node_modules/,
use: {
loader: 'babel-loader',
// options: options.babelQuery,
options: {
presets: ['@babel/preset-typescript'],
plugins: ['@babel/plugin-proposal-optional-chaining'],
},
options: options.babelQuery,
// options: {
// presets: ['@babel/preset-typescript'],
// plugins: ['@babel/plugin-proposal-optional-chaining'],
// },
},
},
{
......@@ -178,6 +176,12 @@ module.exports = options => ({
NODE_ENV: 'development',
}),
new webpack.ProvidePlugin({
process: nodeLibs.process
}),
new FastRefreshPlugin({
overlay: false
}),
new CopyPlugin([
{
from: path.resolve(process.cwd(), './public'),
......@@ -212,6 +216,19 @@ module.exports = options => ({
'@': path.resolve(process.cwd(), './src'),
components: path.resolve(process.cwd(), './src/components'),
cesium: path.resolve(process.cwd(), cesiumSource),
react: path.resolve(process.cwd(), './node_modules/react'),
},
fallback: {
...Object.keys(nodeLibs).reduce((memo, key) => {
if (nodeLibs[key]) {
memo[key] = nodeLibs[key];
} else {
memo[key] = false;
}
return memo;
}, {}),
http: false,
https: false,
},
},
devtool: options.devtool,
......
......@@ -36,10 +36,10 @@ module.exports = require('./webpack.base.babel')({
inject: true, // Inject all files that are generated by webpack, e.g. bundle.js
template: 'src/index.html',
}),
new CircularDependencyPlugin({
exclude: /a\.js|node_modules/, // exclude node_modules
failOnError: false, // show a warning when there is a circular dependency
}),
// new CircularDependencyPlugin({
// exclude: /a\.js|node_modules/, // exclude node_modules
// failOnError: false, // show a warning when there is a circular dependency
// }),
],
devtool: 'cheap-module-source-map',
node: {
......
{
"name": "panda_maintenace",
"version": "0.0.1",
"description": "",
"repository": {
"type": "git",
"url": "https://g.civnet.cn:8443/test/maintenance.git"
},
"engines": {
"npm": ">=5",
"node": ">=8.15.1"
},
"author": "Max Stoiber",
"license": "MIT",
"scripts": {
"init": "npm install --registry=https://g.civnet.cn:4873",
"analyze:clean": "rimraf stats.json",
"preanalyze": "npm run analyze:clean",
"analyze": "node ./internals/scripts/analyze.js",
"npmcheckversion": "node ./internals/scripts/npmcheckversion.js",
"preinstall": "npm run npmcheckversion",
"build": "cross-env NODE_ENV=production node internals/webpack/clean.js",
"build:inspect": "cross-env NODE_ENV=production node --inspect-brk ./node_modules/webpack/bin/webpack.js --config internals/webpack/webpack.prod.babel.js --color -p --progress --hide-modules --display-optimization-bailout",
"build:clean": "node ./internals/webpack/clean.js",
"push": "sh push.sh",
"start": "cross-env NODE_ENV=development node server",
"start:inspect": "cross-env NODE_ENV=development node --inspect=9229 server",
"start:tunnel": "cross-env NODE_ENV=development ENABLE_TUNNEL=true node server",
"start:production": "npm run test && npm run build && npm run start:prod",
"start:prod": "cross-env NODE_ENV=production node server",
"release": "np --no-cleanup --yolo --no-publish",
"cm": "git-cz",
"log": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"docs:dev": "dumi dev",
"docs:build": "dumi build",
"update:deps": "yarn upgrade-interactive --latest",
"presetup": "npm i chalk shelljs",
"setup": "node ./internals/scripts/setup.js",
"generate": "plop --plopfile internals/generators/index.js",
"lint": "npm run lint:js && npm run lint:css",
"lint:css": "stylelint src/**/*.less",
"lint:eslint": "eslint --ignore-path .gitignore --ignore-pattern internals/scripts",
"lint:fix": "eslint --ignore-path .gitignore --ignore-pattern internals/scripts --fix -- .",
"lint:js": "npm run lint:eslint -- . ",
"lint:staged": "lint-staged",
"pretest": "npm run test:clean && npm run lint",
"test:clean": "rimraf ./coverage",
"clean:node_modules": "rimraf ./node_modules",
"test": "cross-env NODE_ENV=test jest --coverage",
"test:watch": "cross-env NODE_ENV=test jest --watchAll",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"prettify": "prettier --write",
"postinstall": "patch-package"
},
"browserslist": [
"last 2 versions",
"> 1%",
"IE 10"
],
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -e $GIT_PARAMS"
}
},
"lint-staged": {
"*.js": [
"npm run lint:fix",
"git add --force"
"name": "panda_maintenace",
"version": "0.0.1",
"description": "",
"repository": {
"type": "git",
"url": "https://g.civnet.cn:8443/test/maintenance.git"
},
"engines": {
"npm": ">=5",
"node": ">=8.15.1"
},
"author": "Max Stoiber",
"license": "MIT",
"scripts": {
"init": "npm install --registry=https://g.civnet.cn:4873",
"analyze:clean": "rimraf stats.json",
"preanalyze": "npm run analyze:clean",
"analyze": "node ./internals/scripts/analyze.js",
"npmcheckversion": "node ./internals/scripts/npmcheckversion.js",
"preinstall": "npm run npmcheckversion",
"build": "cross-env NODE_ENV=production node internals/webpack/clean.js",
"build:inspect": "cross-env NODE_ENV=production node --inspect-brk ./node_modules/webpack/bin/webpack.js --config internals/webpack/webpack.prod.babel.js --color -p --progress --hide-modules --display-optimization-bailout",
"build:clean": "node ./internals/webpack/clean.js",
"push": "sh push.sh",
"start": "cross-env NODE_ENV=development node server",
"start:inspect": "cross-env NODE_ENV=development node --inspect=9229 server",
"start:tunnel": "cross-env NODE_ENV=development ENABLE_TUNNEL=true node server",
"start:production": "npm run test && npm run build && npm run start:prod",
"start:prod": "cross-env NODE_ENV=production node server",
"release": "np --no-cleanup --yolo --no-publish",
"cm": "git-cz",
"log": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"docs:dev": "dumi dev",
"docs:build": "dumi build",
"update:deps": "yarn upgrade-interactive --latest",
"presetup": "npm i chalk shelljs",
"setup": "node ./internals/scripts/setup.js",
"generate": "plop --plopfile internals/generators/index.js",
"lint": "npm run lint:js && npm run lint:css",
"lint:css": "stylelint src/**/*.less",
"lint:eslint": "eslint --ignore-path .gitignore --ignore-pattern internals/scripts",
"lint:fix": "eslint --ignore-path .gitignore --ignore-pattern internals/scripts --fix -- .",
"lint:js": "npm run lint:eslint -- . ",
"lint:staged": "lint-staged",
"pretest": "npm run test:clean && npm run lint",
"test:clean": "rimraf ./coverage",
"clean:node_modules": "rimraf ./node_modules",
"test": "cross-env NODE_ENV=test jest --coverage",
"test:watch": "cross-env NODE_ENV=test jest --watchAll",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"prettify": "prettier --write",
"postinstall": "patch-package"
},
"browserslist": [
"last 2 versions",
"> 1%",
"IE 10"
],
"*.json": [
"prettier --write",
"git add --force"
]
},
"pre-commit": "lint:staged",
"resolutions": {
"babel-core": "7.0.0-bridge.0"
},
"dependencies": {
"@ant-design/pro-card": "^1.4.6",
"@antv/data-set": "^0.11.7",
"@babel/plugin-proposal-optional-chaining": "^7.12.1",
"@babel/polyfill": "7.4.3",
"@babel/preset-typescript": "^7.12.1",
"@babel/runtime": "^7.10.5",
"@wisdom-cesium/cesium": "^1.0.29",
"ace-builds": "^1.4.12",
"antd-img-crop": "^3.13.2",
"bizcharts": "^4.0.15",
"chalk": "2.4.2",
"compression": "1.7.4",
"connected-react-router": "6.4.0",
"copy-webpack-plugin": "5.0.0",
"cross-env": "5.0.0",
"dragm": "^0.0.5",
"express": "4.16.4",
"fontfaceobserver": "2.1.0",
"gojs": "2.1.49",
"react-dnd-html5-backend": "latest",
"react-dnd": "latest",
"immutability-helper": "latest",
"history": "4.9.0",
"hoist-non-react-statics": "3.3.0",
"immer": "3.0.0",
"immutable": "^4.0.0-rc.12",
"intl": "1.2.5",
"invariant": "2.2.4",
"ip": "1.1.5",
"lodash": "4.17.11",
"minimist": "1.2.0",
"prop-types": "15.7.2",
"react": "16.14.0",
"react-ace": "^9.2.0",
"react-copy-to-clipboard": "^5.0.4",
"react-dom": "16.14.0",
"react-grid-layout": "^1.2.5",
"react-helmet": "6.0.0-beta",
"react-html-parser": "^2.0.2",
"react-intl": "2.8.0",
"react-json-view": "^1.21.3",
"react-loader": "^2.4.7",
"react-redux": "7.0.2",
"react-resizable": "^1.11.0",
"react-router-dom": "5.1.0",
"redux": "4.0.1",
"redux-saga": "1.0.2",
"reselect": "4.0.0",
"sanitize.css": "8.0.0",
"sha1": "^1.1.1",
"sortablejs": "^1.13.0",
"styled-components": "4.2.0",
"use-merge-value": "^1.0.2",
"voca": "^1.4.0"
},
"devDependencies": {
"@ant-design/icons": "^4.0.0",
"@ant-design/pro-layout": "^6.4.1",
"@ant-design/pro-table": "^2.5.3",
"@babel/cli": "7.4.3",
"@babel/core": "7.4.3",
"@babel/plugin-proposal-class-properties": "7.4.0",
"@babel/plugin-syntax-dynamic-import": "7.2.0",
"@babel/plugin-transform-modules-commonjs": "7.4.3",
"@babel/plugin-transform-react-constant-elements": "7.2.0",
"@babel/plugin-transform-react-inline-elements": "7.2.0",
"@babel/preset-env": "7.4.3",
"@babel/preset-react": "7.0.0",
"@babel/register": "7.4.0",
"@commitlint/cli": "^9.1.2",
"@commitlint/config-conventional": "^9.1.2",
"add-asset-html-webpack-plugin": "3.1.3",
"antd": "^4.5.3",
"axios": "^0.19.2",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.1",
"babel-loader": "8.0.5",
"babel-plugin-dynamic-import-node": "2.2.0",
"babel-plugin-import": "^1.13.0",
"babel-plugin-lodash": "3.3.4",
"babel-plugin-react-intl": "3.0.1",
"babel-plugin-styled-components": "1.10.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"circular-dependency-plugin": "5.0.2",
"classnames": "^2.2.6",
"compare-versions": "3.4.0",
"compression-webpack-plugin": "2.0.0",
"conventional-changelog-cli": "^2.1.0",
"core-js": "^3.6.5",
"coveralls": "3.0.3",
"css-loader": "^4.2.1",
"cz-customizable": "^6.3.0",
"dumi": "^1.0.13",
"eslint": "5.16.0",
"eslint-config-airbnb": "17.1.0",
"eslint-config-airbnb-base": "13.1.0",
"eslint-config-prettier": "4.1.0",
"eslint-import-resolver-webpack": "0.11.1",
"eslint-plugin-import": "2.17.2",
"eslint-plugin-jsx-a11y": "6.2.1",
"eslint-plugin-prettier": "3.0.1",
"eslint-plugin-react": "7.12.4",
"eslint-plugin-react-hooks": "1.6.0",
"eslint-plugin-redux-saga": "1.0.0",
"file-loader": "3.0.1",
"html-loader": "0.5.5",
"html-webpack-plugin": "3.2.0",
"http-proxy-middleware": "^1.0.6",
"husky": "^2.3.0",
"imports-loader": "0.8.0",
"jest-cli": "24.7.1",
"jest-dom": "3.1.3",
"jest-styled-components": "6.3.1",
"less": "3.12.0",
"less-loader": "5.0.0",
"lint-staged": "8.1.5",
"lodash": "^4.17.11",
"moment": "^2.25.3",
"ngrok": "3.1.1",
"node-plop": "0.18.0",
"null-loader": "0.1.1",
"offline-plugin": "5.0.6",
"patch-package": "^6.4.7",
"path-to-regexp": "2.4.0",
"plop": "2.3.0",
"postcss": "7.0.32",
"postcss-flexbugs-fixes": "4.2.1",
"postcss-loader": "3.0.0",
"postcss-preset-env": "6.7.0",
"postcss-safe-parser": "4.0.2",
"pre-commit": "1.2.2",
"prettier": "1.17.0",
"qs": "^6.9.0",
"react": "^16.14.0",
"react-app-polyfill": "0.2.2",
"react-dom": "^16.14.0",
"react-helmet-async": "^1.0.4",
"react-router-config": "^5.1.1",
"react-test-renderer": "16.14.0",
"react-testing-library": "6.1.2",
"redux-immutable": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"regenerator-runtime": "^0.13.7",
"rimraf": "2.6.3",
"shelljs": "0.8.3",
"slash2": "^2.0.0",
"style-loader": "^1.2.1",
"stylelint": "10.0.1",
"stylelint-config-recommended": "2.2.0",
"stylelint-config-styled-components": "0.1.1",
"stylelint-processor-styled-components": "1.6.0",
"svg-url-loader": "2.3.2",
"terser-webpack-plugin": "1.2.3",
"url-loader": "1.1.2",
"webpack": "4.30.0",
"webpack-cli": "3.3.0",
"webpack-dev-middleware": "3.6.2",
"webpack-hot-middleware": "2.24.3",
"webpack-pwa-manifest": "4.0.0",
"whatwg-fetch": "3.0.0",
"yorkie": "^2.0.0"
}
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -e $GIT_PARAMS"
}
},
"lint-staged": {
"*.js": [
"npm run lint:fix",
"git add --force"
],
"*.json": [
"prettier --write",
"git add --force"
]
},
"pre-commit": "lint:staged",
"resolutions": {
"babel-core": "7.0.0-bridge.0"
},
"dependencies": {
"@ant-design/pro-card": "^1.4.6",
"@antv/data-set": "^0.11.7",
"@babel/plugin-proposal-optional-chaining": "^7.12.1",
"@babel/polyfill": "7.4.3",
"@babel/preset-typescript": "^7.12.1",
"@babel/runtime": "^7.10.5",
"@wisdom-cesium/cesium": "^1.0.29",
"@wisdom-map/arcgismap": "^1.0.79-26",
"@esri/arcgis-html-sanitizer": "2.9.1",
"@esri/calcite-colors": "6.0.3",
"ace-builds": "^1.4.12",
"antd-img-crop": "^3.13.2",
"bizcharts": "^4.0.15",
"chalk": "2.4.2",
"compression": "1.7.4",
"connected-react-router": "6.4.0",
"copy-webpack-plugin": "5.0.0",
"cross-env": "5.0.0",
"dragm": "^0.0.5",
"express": "4.16.4",
"fontfaceobserver": "2.1.0",
"gojs": "2.1.49",
"history": "4.9.0",
"hoist-non-react-statics": "3.3.0",
"immer": "3.0.0",
"immutability-helper": "latest",
"immutable": "^4.0.0-rc.12",
"intl": "1.2.5",
"invariant": "2.2.4",
"ip": "1.1.5",
"lodash": "4.17.11",
"minimist": "1.2.0",
"prop-types": "15.7.2",
"react": "16.14.0",
"react-ace": "^9.2.0",
"react-copy-to-clipboard": "^5.0.4",
"react-dnd": "latest",
"react-dnd-html5-backend": "latest",
"react-dom": "16.14.0",
"react-grid-layout": "^1.2.5",
"react-helmet": "6.0.0-beta",
"react-html-parser": "^2.0.2",
"react-intl": "2.8.0",
"react-json-view": "^1.21.3",
"react-loader": "^2.4.7",
"react-redux": "7.0.2",
"react-resizable": "^1.11.0",
"react-router-dom": "5.1.0",
"redux": "4.0.1",
"redux-saga": "1.0.2",
"reselect": "4.0.0",
"sanitize.css": "8.0.0",
"sha1": "^1.1.1",
"sortablejs": "^1.13.0",
"styled-components": "4.2.0",
"use-merge-value": "^1.0.2",
"voca": "^1.4.0"
},
"devDependencies": {
"@ant-design/icons": "^4.0.0",
"@ant-design/pro-layout": "^6.4.1",
"@ant-design/pro-table": "^2.5.3",
"@babel/cli": "7.4.3",
"@babel/core": "7.4.3",
"@babel/plugin-syntax-top-level-await": "^7.14.5",
"@babel/plugin-proposal-decorators": "^7.17.9",
"@babel/plugin-proposal-export-default-from": "^7.16.7",
"@babel/plugin-proposal-pipeline-operator": "^7.17.6",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
"@babel/plugin-proposal-do-expressions": "^7.16.7",
"@babel/plugin-proposal-function-bind": "^7.16.7",
"@babel/plugin-proposal-logical-assignment-operators": "^7.16.7",
"babel-plugin-react-require": "^3.1.3",
"@babel/plugin-proposal-class-properties": "7.4.0",
"@babel/plugin-syntax-dynamic-import": "7.2.0",
"@babel/plugin-transform-modules-commonjs": "7.4.3",
"@babel/plugin-transform-react-constant-elements": "7.2.0",
"@babel/plugin-transform-react-inline-elements": "7.2.0",
"@babel/preset-env": "7.4.3",
"@babel/preset-react": "7.0.0",
"@babel/register": "7.4.0",
"@commitlint/cli": "^9.1.2",
"@commitlint/config-conventional": "^9.1.2",
"add-asset-html-webpack-plugin": "3.1.3",
"antd": "^4.5.3",
"axios": "^0.19.2",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.1",
"babel-loader": "8.0.5",
"babel-plugin-dynamic-import-node": "2.2.0",
"babel-plugin-import": "^1.13.0",
"babel-plugin-lodash": "3.3.4",
"babel-plugin-react-intl": "3.0.1",
"babel-plugin-styled-components": "1.10.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
"react-refresh": "^0.9.0",
"circular-dependency-plugin": "5.0.2",
"classnames": "^2.2.6",
"compare-versions": "3.4.0",
"compression-webpack-plugin": "2.0.0",
"conventional-changelog-cli": "^2.1.0",
"core-js": "^3.6.5",
"coveralls": "3.0.3",
"css-loader": "^4.2.1",
"cz-customizable": "^6.3.0",
"dumi": "^1.0.13",
"eslint": "5.16.0",
"eslint-config-airbnb": "17.1.0",
"eslint-config-airbnb-base": "13.1.0",
"eslint-config-prettier": "4.1.0",
"eslint-import-resolver-webpack": "0.11.1",
"eslint-plugin-import": "2.17.2",
"eslint-plugin-jsx-a11y": "6.2.1",
"eslint-plugin-prettier": "3.0.1",
"eslint-plugin-react": "7.12.4",
"eslint-plugin-react-hooks": "1.6.0",
"eslint-plugin-redux-saga": "1.0.0",
"file-loader": "3.0.1",
"html-loader": "0.5.5",
"html-webpack-plugin": "^4.4.0",
"http-proxy-middleware": "^1.0.6",
"husky": "^2.3.0",
"i": "^0.3.7",
"imports-loader": "0.8.0",
"jest-cli": "24.7.1",
"jest-dom": "3.1.3",
"jest-styled-components": "6.3.1",
"less": "3.12.0",
"less-loader": "5.0.0",
"lint-staged": "8.1.5",
"lodash": "^4.17.11",
"moment": "^2.25.3",
"ngrok": "3.1.1",
"node-plop": "0.18.0",
"npm": "^8.7.0",
"null-loader": "0.1.1",
"offline-plugin": "5.0.6",
"patch-package": "^6.4.7",
"path-to-regexp": "2.4.0",
"plop": "2.3.0",
"postcss": "7.0.32",
"postcss-flexbugs-fixes": "4.2.1",
"postcss-loader": "3.0.0",
"postcss-preset-env": "6.7.0",
"postcss-safe-parser": "4.0.2",
"pre-commit": "1.2.2",
"prettier": "1.17.0",
"qs": "^6.9.0",
"react": "^16.14.0",
"react-app-polyfill": "0.2.2",
"react-dom": "^16.14.0",
"react-helmet-async": "^1.0.4",
"react-router-config": "^5.1.1",
"react-test-renderer": "16.14.0",
"react-testing-library": "6.1.2",
"redux-immutable": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"regenerator-runtime": "^0.13.7",
"rimraf": "2.6.3",
"shelljs": "0.8.3",
"slash2": "^2.0.0",
"style-loader": "^1.2.1",
"stylelint": "10.0.1",
"stylelint-config-recommended": "2.2.0",
"stylelint-config-styled-components": "0.1.1",
"stylelint-processor-styled-components": "1.6.0",
"svg-url-loader": "2.3.2",
"terser-webpack-plugin": "1.2.3",
"url-loader": "1.1.2",
"webpack": "5.70.0",
"webpack-cli": "4.2.0",
"webpack-dev-middleware": "5.3.0",
"webpack-hot-middleware": "2.24.3",
"webpack-pwa-manifest": "4.0.0",
"whatwg-fetch": "3.0.0",
"yorkie": "^2.0.0"
}
}
......@@ -6,9 +6,9 @@ const { addProxyMiddleware } = require('../proxy');
function createWebpackMiddleware(compiler, publicPath) {
return webpackDevMiddleware(compiler, {
logLevel: 'warn',
// logLevel: 'warn',
publicPath,
silent: true,
// silent: true,
stats: 'errors-only',
});
}
......@@ -25,7 +25,7 @@ module.exports = function addDevMiddlewares(app, webpackConfig) {
addProxyMiddleware(app);
// Since webpackDevMiddleware uses memory-fs internally to store build
// artifacts, we use it instead
const fs = middleware.fileSystem;
const fs = middleware.context.outputFileSystem;
app.get('*', (_req, res) => {
fs.readFile(path.join(compiler.outputPath, 'index.html'), (err, file) => {
......
/* eslint-disable */
import '!file-loader?name=[name].[ext]!./images/favicon.ico';
import './global.less';
import '@babel/polyfill';
......@@ -7,15 +8,13 @@ import 'sanitize.css/sanitize.css';
import React from 'react';
import ReactDOM from 'react-dom';
import { ArcGISMap as MapComponent } from '@wisdom-map/arcgismap';
import { ConfigProvider } from 'antd';
import zhCN from 'antd/es/locale/zh_CN';
import { ConnectedRouter } from 'connected-react-router/immutable';
import Immutable from 'immutable';
import { Provider } from 'react-redux';
import { PictureWallProvider } from '@/components/Upload/context';
import configureStore from './configureStore';
import App from './containers/App';
import config from './routes/config';
......@@ -25,30 +24,30 @@ const initialState = Immutable.Map();
const store = configureStore(initialState, history);
const MOUNT_NODE = document.getElementById('app');
const render = () => {
ReactDOM.render(
<Provider store={store}>
<ConnectedRouter history={history}>
<ConfigProvider locale={zhCN}>
{/* <PictureWallProvider> */}
<App routesConfig={config} />
{/* </PictureWallProvider> */}
</ConfigProvider>
</ConnectedRouter>
</Provider>,
MOUNT_NODE,
);
ReactDOM.render(
<Provider store = { store }>
<ConnectedRouter history = { history }>
<ConfigProvider locale = { zhCN } >
{ /* <PictureWallProvider> */ }
<App routesConfig = { config }/>
{ /* </PictureWallProvider> */ }
</ConfigProvider>
</ConnectedRouter>
</Provider>,
MOUNT_NODE,
);
};
if (module.hot) {
module.hot.accept(['./containers/App'], () => {
ReactDOM.unmountComponentAtNode(MOUNT_NODE);
render();
});
module.hot.accept(['./containers/App'], () => {
ReactDOM.unmountComponentAtNode(MOUNT_NODE);
render();
});
}
if (MOUNT_NODE) {
render();
render();
}
if (process.env.NODE_ENV === 'production') {
require('offline-plugin/runtime').install(); // eslint-disable-line global-require
require('offline-plugin/runtime').install(); // eslint-disable-line global-require
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment