Skip to content

Commit 9dfa73b

Browse files
committed
stylelint
1 parent 6f6f0a0 commit 9dfa73b

11 files changed

+1171
-2799
lines changed

.babelrc.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
module.exports = {
3+
presets: [
4+
[
5+
'@babel/preset-env',
6+
{
7+
targets: '> 0.25%, not dead',
8+
ignoreBrowserslistConfig: true,
9+
useBuiltIns: false,
10+
modules: false,
11+
exclude: ['transform-typeof-symbol']
12+
}
13+
],
14+
'@babel/preset-react',
15+
[
16+
'@babel/preset-typescript',
17+
{
18+
isTSX: true,
19+
allExtensions: true,
20+
allowNamespaces: true,
21+
allowDeclareFields: true
22+
}
23+
]
24+
],
25+
plugins: [
26+
[
27+
'@babel/plugin-proposal-decorators',
28+
{legacy: true}
29+
],
30+
[
31+
'@babel/plugin-proposal-class-properties',
32+
{loose: true}
33+
]
34+
]
35+
}

.browserslistrc

Lines changed: 0 additions & 2 deletions
This file was deleted.

.stylelintrc.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ module.exports = {
77
'selector-pseudo-class-no-unknown': null,
88
'declaration-colon-newline-after': null,
99
'no-descending-specificity': null,
10-
'max-empty-lines': 2
10+
'max-empty-lines': 2,
11+
'at-rule-no-unknown': [true, {
12+
ignoreAtRules: [/for|while|include/]
13+
}]
1114
},
1215
ignoreFiles: [
1316
'node_modules/**/*',

build/webpack.base.conf.js

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const path = require('path'),
33
styleRules = require('./styleLoaderConf'),
44
CopyWebpackPlugin = require('copy-webpack-plugin'),
55
MiniCssExtractPlugin = require("mini-css-extract-plugin"),
6-
ManifestPlugin = require('webpack-manifest-plugin'),
76
{GenerateSW} = require('workbox-webpack-plugin');
87

98
const _PROD_ = process.env.NODE_ENV === 'production';
@@ -23,7 +22,7 @@ module.exports = {
2322
publicPath: '/', // root Dir
2423
sourceMapFilename: '[name].map',
2524
chunkFilename: 'static/js/[name].[chunkhash:8].js',
26-
filename: 'static/js/[name].[hash:8].js'
25+
filename: 'static/js/[name].[contenthash:8].js'
2726
},
2827

2928
resolveLoader: {
@@ -57,41 +56,41 @@ module.exports = {
5756
],
5857
exclude: /node_modules/,
5958
loader: "babel-loader",
60-
options: {
61-
presets: [
62-
["@babel/preset-env", {
63-
targets: { ie: 9, },
64-
ignoreBrowserslistConfig: true,
65-
useBuiltIns: false,
66-
modules: false,
67-
exclude: ['transform-typeof-symbol'],
68-
}],
69-
["@babel/preset-react", {
70-
"targets": "last 2 versions, ie 11", "modules": false
71-
}],
72-
["@babel/preset-typescript"]
73-
],
74-
plugins: [
75-
['@babel/plugin-syntax-dynamic-import'],
76-
['@babel/plugin-proposal-decorators', {legacy: true}],
77-
['@babel/plugin-proposal-class-properties', {loose: true}]
78-
]
79-
}
59+
// options: {
60+
// presets: [
61+
// ["@babel/preset-env", {
62+
// targets: { ie: 9, },
63+
// ignoreBrowserslistConfig: true,
64+
// useBuiltIns: false,
65+
// modules: false,
66+
// exclude: ['transform-typeof-symbol'],
67+
// }],
68+
// ["@babel/preset-react", {
69+
// "targets": "last 2 versions, ie 11", "modules": false
70+
// }],
71+
// ["@babel/preset-typescript"]
72+
// ],
73+
// plugins: [
74+
// ['@babel/plugin-syntax-dynamic-import'],
75+
// ['@babel/plugin-proposal-decorators', {legacy: true}],
76+
// ['@babel/plugin-proposal-class-properties', {loose: true}]
77+
// ]
78+
// }
8079
},
8180
...styleRules,
8281
{
8382
test: /\.(eot|woff|woff2|ttf)(\?\S*)?$/,
8483
loader: "url-loader",
8584
options: {
86-
name: "assets/fonts/[name].[hash:8].[ext]",
85+
name: "assets/fonts/[name].[contenthash:8].[ext]",
8786
limit: 2048
8887
}
8988
},
9089
{
9190
test: /\.(svg|png|jpe?g|gif)(\?\S*)?$/,
9291
loader: "url-loader",
9392
options: {
94-
name: "assets/imgs/[name].[hash:8].[ext]",
93+
name: "assets/imgs/[name].[contenthash:8].[ext]",
9594
limit: 2048
9695
}
9796
}
@@ -187,7 +186,7 @@ module.exports = {
187186
// },
188187
// _DEV_: JSON.stringify(_DEV_),
189188
// }),
190-
new GenerateSW(),
189+
// new GenerateSW(),
191190
// new ManifestPlugin({
192191
// fileName: 'asset-manifest.json'
193192
// }),

build/webpack.dev.conf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module.exports = merge(webpackConfig, {
2626
// inline: true,
2727
https: false, // true for self-signed, object for cert authority
2828
// noInfo: true, // only errors & warns on hot reload
29+
progress: true,
2930
},
3031
plugins: [
3132
new webpack.HotModuleReplacementPlugin(),

build/webpack.prod.conf.js

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
11
'use strict'
2-
const path = require('path')
3-
const webpack = require('webpack')
4-
const merge = require('webpack-merge')
5-
const baseWebpackConfig = require('./webpack.base.conf')
6-
const HtmlWebpackPlugin = require('html-webpack-plugin')
7-
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
8-
const CleanWebpackPlugin = require('clean-webpack-plugin')
9-
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin")
2+
const path = require('path'),
3+
webpack = require('webpack'),
4+
TerserPlugin = require("terser-webpack-plugin"),
5+
{merge} = require('webpack-merge'),
6+
baseWebpackConfig = require('./webpack.base.conf'),
7+
HtmlWebpackPlugin = require('html-webpack-plugin'),
8+
// UglifyJsPlugin = require('uglifyjs-webpack-plugin'),
9+
OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
1010

1111
const _PROD_ = process.env.NODE_ENV === 'production'
1212

13-
const webpackConfig = merge(baseWebpackConfig, {
13+
module.exports = merge(baseWebpackConfig, {
1414
mode: 'production',
1515
devtool: false,
16+
optimization: {
17+
minimizer: [new TerserPlugin()]
18+
},
1619
plugins: [
17-
new CleanWebpackPlugin(['dist'], {root: path.resolve(__dirname, '../')}),
18-
new OptimizeCSSAssetsPlugin({
19-
// cssProcessor: require('cssnano')({ autoprefixer: false })
20-
}),
21-
new UglifyJsPlugin({
22-
uglifyOptions: {
23-
compress: {
24-
warnings: false,
25-
drop_console: _PROD_ ? true : false,
26-
},
27-
output: {
28-
comments: false
29-
}
30-
},
31-
parallel: true
32-
}),
33-
new HtmlWebpackPlugin({
34-
title: 'CMS-React',
35-
filename: 'index.html',
36-
template: path.resolve(__dirname, '../src/index.html'),
37-
inject: true,
38-
minify: {
39-
minifyJS: true,
40-
removeComments: true,
41-
collapseWhitespace: true,
42-
removeAttributeQuotes: true
43-
},
44-
}),
20+
// new OptimizeCSSAssetsPlugin({
21+
// // cssProcessor: require('cssnano')({ autoprefixer: false })
22+
// }),
23+
// new UglifyJsPlugin({
24+
// uglifyOptions: {
25+
// compress: {
26+
// warnings: false,
27+
// drop_console: _PROD_ ? true : false,
28+
// },
29+
// output: {
30+
// comments: false
31+
// }
32+
// },
33+
// parallel: true
34+
// }),
35+
// new HtmlWebpackPlugin({
36+
// title: 'CMS-React',
37+
// filename: 'index.html',
38+
// template: path.resolve(__dirname, '../src/index.html'),
39+
// inject: true,
40+
// minify: {
41+
// minifyJS: true,
42+
// removeComments: true,
43+
// collapseWhitespace: true,
44+
// removeAttributeQuotes: true
45+
// },
46+
// }),
4547
// keep modules.id stable when vendor modules does not change
46-
new webpack.HashedModuleIdsPlugin(),
48+
// new webpack.HashedModuleIdsPlugin(),
4749
]
4850
})
49-
50-
module.exports = webpackConfig

package.json

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,45 +33,42 @@
3333
"react-router-dom": "^5.1.2"
3434
},
3535
"devDependencies": {
36-
"@babel/core": "^7.2.0",
37-
"@babel/plugin-proposal-class-properties": "^7.2.1",
38-
"@babel/plugin-proposal-decorators": "^7.2.0",
39-
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
40-
"@babel/preset-env": "^7.2.0",
41-
"@babel/preset-react": "^7.0.0",
42-
"@babel/preset-typescript": "^7.1.0",
36+
"@babel/core": "^7.12.10",
37+
"@babel/plugin-proposal-class-properties": "^7.12.1",
38+
"@babel/plugin-proposal-decorators": "^7.12.1",
39+
"@babel/preset-env": "^7.12.11",
40+
"@babel/preset-react": "^7.12.10",
41+
"@babel/preset-typescript": "^7.12.7",
4342
"@types/echarts": "^4.1.3",
4443
"@types/quill": "^2.0.1",
4544
"@types/react": "^16.7.7",
4645
"@types/react-dom": "^16.0.10",
4746
"@types/react-router-dom": "^4.3.1",
4847
"@typescript-eslint/eslint-plugin": "^4.10.0",
4948
"@typescript-eslint/parser": "^4.10.0",
50-
"babel-loader": "^8.0.4",
51-
"clean-webpack-plugin": "^0.1.19",
49+
"babel-loader": "^8.2.2",
5250
"copy-webpack-plugin": "^7.0.0",
5351
"css-loader": "^5.0.1",
5452
"eslint": "^7.15.0",
5553
"eslint-plugin-react": "^7.21.5",
56-
"html-webpack-plugin": "^4.5.0",
54+
"html-webpack-plugin": "^5.0.0-alpha.17",
5755
"husky": "^4.3.6",
5856
"lint-staged": "^10.5.3",
5957
"mini-css-extract-plugin": "^1.3.3",
6058
"node-sass": "^5.0.0",
61-
"optimize-css-assets-webpack-plugin": "^5.0.1",
59+
"optimize-css-assets-webpack-plugin": "^5.0.4",
6260
"postcss-loader": "^4.1.0",
6361
"postcss-preset-env": "^6.7.0",
6462
"sass-loader": "^10.1.0",
6563
"style-loader": "^2.0.0",
6664
"stylelint": "^13.8.0",
6765
"stylelint-config-standard": "^20.0.0",
68-
"typescript": "^3.6.4",
69-
"uglifyjs-webpack-plugin": "^2.0.1",
70-
"url-loader": "^1.1.2",
66+
"terser-webpack-plugin": "^5.0.3",
67+
"typescript": "^4.1.3",
68+
"url-loader": "^4.1.1",
7169
"webpack": "^5.10.3",
7270
"webpack-cli": "^3.3.12",
7371
"webpack-dev-server": "^3.11.0",
74-
"webpack-manifest-plugin": "^2.0.4",
7572
"webpack-merge": "^5.7.2",
7673
"workbox-webpack-plugin": "^6.0.2"
7774
},

0 commit comments

Comments
 (0)