diff options
author | crupest <crupest@outlook.com> | 2020-06-02 01:01:15 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-06-02 01:01:15 +0800 |
commit | 447184ca4ae3f691c0b7007cbb1f002862f12566 (patch) | |
tree | a8ab10a615bf4a9e65df9dbf060e15325a020a51 | |
parent | 5021d95f57c54779d1fd22aeeb180be058775a01 (diff) | |
download | timeline-447184ca4ae3f691c0b7007cbb1f002862f12566.tar.gz timeline-447184ca4ae3f691c0b7007cbb1f002862f12566.tar.bz2 timeline-447184ca4ae3f691c0b7007cbb1f002862f12566.zip |
Upgrade packages.
-rw-r--r-- | Timeline/ClientApp/.eslintignore | 5 | ||||
-rw-r--r-- | Timeline/ClientApp/.eslintrc.js | 2 | ||||
-rw-r--r-- | Timeline/ClientApp/.yarnrc.yml | 6 | ||||
-rw-r--r-- | Timeline/ClientApp/package.json | 36 | ||||
-rw-r--r-- | Timeline/ClientApp/tsconfig-for-webpack-config.json | 13 | ||||
-rw-r--r-- | Timeline/ClientApp/webpack.common.js (renamed from Timeline/ClientApp/webpack.common.ts) | 15 | ||||
-rw-r--r-- | Timeline/ClientApp/webpack.config.dev.js (renamed from Timeline/ClientApp/webpack.config.dev.ts) | 16 | ||||
-rw-r--r-- | Timeline/ClientApp/webpack.config.prod.js (renamed from Timeline/ClientApp/webpack.config.prod.ts) | 33 |
8 files changed, 59 insertions, 67 deletions
diff --git a/Timeline/ClientApp/.eslintignore b/Timeline/ClientApp/.eslintignore new file mode 100644 index 00000000..371b5fcb --- /dev/null +++ b/Timeline/ClientApp/.eslintignore @@ -0,0 +1,5 @@ +.yarn
+node_modules
+dist
+webpack.*.js
+.eslintrc.js
diff --git a/Timeline/ClientApp/.eslintrc.js b/Timeline/ClientApp/.eslintrc.js index e1cd037e..1ffb15de 100644 --- a/Timeline/ClientApp/.eslintrc.js +++ b/Timeline/ClientApp/.eslintrc.js @@ -20,7 +20,7 @@ module.exports = { }, parser: '@typescript-eslint/parser', parserOptions: { - project: ['./tsconfig.json', './tsconfig-for-webpack-config.json'], + project: ['./tsconfig.json'], ecmaFeatures: { jsx: true, }, diff --git a/Timeline/ClientApp/.yarnrc.yml b/Timeline/ClientApp/.yarnrc.yml index 5614d154..0e4fbd7d 100644 --- a/Timeline/ClientApp/.yarnrc.yml +++ b/Timeline/ClientApp/.yarnrc.yml @@ -1 +1,5 @@ -yarnPath: ".yarn/releases/yarn-berry.js"
+plugins:
+ - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.js
+ spec: "@yarnpkg/plugin-interactive-tools"
+
+yarnPath: .yarn/releases/yarn-berry.js
diff --git a/Timeline/ClientApp/package.json b/Timeline/ClientApp/package.json index f47749b0..7742fb87 100644 --- a/Timeline/ClientApp/package.json +++ b/Timeline/ClientApp/package.json @@ -5,10 +5,10 @@ "homepage": "https://crupest.xyz", "dependencies": { "@fortawesome/fontawesome-free": "^5.13.0", - "axios": "^0.19.0", + "axios": "^0.19.2", "bootstrap": "^4.5.0", "classnames": "^2.2.6", - "clsx": "^1.0.4", + "clsx": "^1.1.1", "core-js": "^3.6.5", "i18next": "^19.4.5", "i18next-browser-languagedetector": "^4.2.0", @@ -27,8 +27,8 @@ "xregexp": "^4.3.0" }, "scripts": { - "start": "cross-env TS_NODE_PROJECT=\"tsconfig-for-webpack-config.json\" webpack-dev-server --config ./webpack.config.dev.ts", - "build": "cross-env TS_NODE_PROJECT=\"tsconfig-for-webpack-config.json\" webpack --config ./webpack.config.prod.ts", + "start": "webpack-dev-server --config ./webpack.config.dev.js", + "build": "webpack --config ./webpack.config.prod.js", "lint": "eslint src/ --ext .js --ext .jsx --ext .ts --ext .tsx" }, "browserslist": { @@ -44,20 +44,18 @@ ] }, "devDependencies": { - "@babel/core": "^7.10.1", + "@babel/core": "^7.10.2", "@babel/plugin-proposal-class-properties": "^7.10.1", "@babel/plugin-proposal-decorators": "^7.10.1", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1", "@babel/plugin-proposal-optional-chaining": "^7.10.1", - "@babel/plugin-syntax-dynamic-import": "^7.2.0", - "@babel/preset-env": "^7.10.1", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/preset-env": "^7.10.2", "@babel/preset-react": "^7.10.1", "@babel/preset-typescript": "^7.10.1", "@hot-loader/react-dom": "^16.13.0", "@types/classnames": "^2.2.10", - "@types/copy-webpack-plugin": "^5.0.1", - "@types/html-webpack-plugin": "^3.2.3", - "@types/lodash": "^4.14.153", + "@types/lodash": "^4.14.154", "@types/node": "^14.0.6", "@types/react": "^16.9.35", "@types/react-dom": "^16.9.8", @@ -65,19 +63,15 @@ "@types/react-router": "^5.1.7", "@types/react-router-dom": "^5.1.5", "@types/reactstrap": "^8.4.2", - "@types/webpack": "^4.41.14", - "@types/webpack-dev-server": "^3.11.0", - "@types/webpack-env": "^1.15.2", "@types/xregexp": "^4.3.0", - "@typescript-eslint/eslint-plugin": "^2.34.0", - "@typescript-eslint/parser": "^2.34.0", + "@typescript-eslint/eslint-plugin": "^3.0.2", + "@typescript-eslint/parser": "^3.0.2", "autoprefixer": "^9.8.0", "babel-loader": "^8.1.0", "clean-webpack-plugin": "^3.0.0", - "copy-webpack-plugin": "^5.0.4", - "cross-env": "^7.0.2", + "copy-webpack-plugin": "^6.0.1", "css-loader": "^3.5.3", - "eslint": "^6.7.1", + "eslint": "^7.1.0", "eslint-config-prettier": "^6.11.0", "eslint-plugin-prettier": "^3.1.3", "eslint-plugin-react": "^7.20.0", @@ -93,12 +87,10 @@ "sass": "^1.26.7", "sass-loader": "^8.0.2", "style-loader": "^1.2.1", - "ts-node": "^8.10.2", - "tsconfig-paths": "^3.9.0", - "typescript": "^3.9.3", + "typescript": "^3.9.4", "url-loader": "^4.1.0", "webpack": "^4.43.0", - "webpack-cli": "^3.3.9", + "webpack-cli": "^3.3.11", "webpack-dev-server": "^3.11.0" } } diff --git a/Timeline/ClientApp/tsconfig-for-webpack-config.json b/Timeline/ClientApp/tsconfig-for-webpack-config.json deleted file mode 100644 index bb6f2a7a..00000000 --- a/Timeline/ClientApp/tsconfig-for-webpack-config.json +++ /dev/null @@ -1,13 +0,0 @@ -{
- "compilerOptions": {
- "module": "commonjs",
- "target": "es5",
- "esModuleInterop": true
- },
- "include": [
- "webpack.common.ts",
- "webpack.config.dev.ts",
- "webpack.config.prod.ts",
- "webpack.config.prod.dev.ts"
- ]
-}
\ No newline at end of file diff --git a/Timeline/ClientApp/webpack.common.ts b/Timeline/ClientApp/webpack.common.js index c4e95e54..4a0527ea 100644 --- a/Timeline/ClientApp/webpack.common.ts +++ b/Timeline/ClientApp/webpack.common.js @@ -1,9 +1,7 @@ -import webpack from 'webpack';
-import HtmlWebpackPlugin from 'html-webpack-plugin';
-import autoprefixer from 'autoprefixer';
-import htmlWebpackTemplate from 'html-webpack-template';
+const autoprefixer = require('autoprefixer');
+const htmlWebpackTemplate = require('html-webpack-template');
-export const commonRules: webpack.RuleSetRule[] = [
+const commonRules = [
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
@@ -37,7 +35,7 @@ export const commonRules: webpack.RuleSetRule[] = [ },
];
-export const htmlCommonConfig: HtmlWebpackPlugin.Options = {
+const htmlCommonConfig = {
inject: false,
template: htmlWebpackTemplate,
@@ -55,3 +53,8 @@ export const htmlCommonConfig: HtmlWebpackPlugin.Options = { `,
title: 'Timeline',
};
+
+module.exports = {
+ commonRules,
+ htmlCommonConfig,
+};
diff --git a/Timeline/ClientApp/webpack.config.dev.ts b/Timeline/ClientApp/webpack.config.dev.js index 17c227b3..12b25253 100644 --- a/Timeline/ClientApp/webpack.config.dev.ts +++ b/Timeline/ClientApp/webpack.config.dev.js @@ -1,12 +1,12 @@ -import path from 'path';
-import webpack from 'webpack';
-import HtmlWebpackPlugin from 'html-webpack-plugin';
-import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
-import PnpWebpackPlugin from 'pnp-webpack-plugin';
+const path = require('path');
+const webpack = require('webpack');
+const HtmlWebpackPlugin = require('html-webpack-plugin');
+const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
+const PnpWebpackPlugin = require('pnp-webpack-plugin');
-import { commonRules, htmlCommonConfig } from './webpack.common';
+const { commonRules, htmlCommonConfig } = require('./webpack.common');
-const config: webpack.Configuration = {
+const config = {
entry: ['react-hot-loader/patch', './src/index.tsx'],
mode: 'development',
devtool: 'eval-source-map',
@@ -70,4 +70,4 @@ const config: webpack.Configuration = { ],
};
-export default config;
+module.exports = config;
diff --git a/Timeline/ClientApp/webpack.config.prod.ts b/Timeline/ClientApp/webpack.config.prod.js index f7cb0374..2115824d 100644 --- a/Timeline/ClientApp/webpack.config.prod.ts +++ b/Timeline/ClientApp/webpack.config.prod.js @@ -1,14 +1,13 @@ -import path from 'path';
-import webpack from 'webpack';
-import { CleanWebpackPlugin } from 'clean-webpack-plugin';
-import HtmlWebpackPlugin from 'html-webpack-plugin';
-import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
-import CopyPlugin from 'copy-webpack-plugin';
-import PnpWebpackPlugin from 'pnp-webpack-plugin';
+const path = require('path');
+const { CleanWebpackPlugin } = require('clean-webpack-plugin');
+const HtmlWebpackPlugin = require('html-webpack-plugin');
+const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
+const CopyPlugin = require('copy-webpack-plugin');
+const PnpWebpackPlugin = require('pnp-webpack-plugin');
-import { commonRules, htmlCommonConfig } from './webpack.common';
+const { commonRules, htmlCommonConfig } = require('./webpack.common');
-const config: webpack.Configuration = {
+const config = {
entry: ['./src/index.tsx'],
mode: 'production',
devtool: 'source-map',
@@ -52,13 +51,15 @@ const config: webpack.Configuration = { new CleanWebpackPlugin(),
new HtmlWebpackPlugin(htmlCommonConfig),
new ForkTsCheckerWebpackPlugin(),
- new CopyPlugin([
- {
- from: path.resolve(__dirname, 'public/'),
- to: path.resolve(__dirname, 'dist/'),
- },
- ]),
+ new CopyPlugin({
+ patterns: [
+ {
+ from: path.resolve(__dirname, 'public/'),
+ to: path.resolve(__dirname, 'dist/'),
+ },
+ ],
+ }),
],
};
-export default config;
+module.exports = config;
|