1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-06 06:07:33 +02:00

Update dependencies

This commit is contained in:
Phuoc Nguyen
2021-03-28 19:50:17 +07:00
parent 70eb2e847e
commit 2e3ca01022
2 changed files with 43 additions and 73 deletions

View File

@@ -2,51 +2,51 @@
"name": "csslayout", "name": "csslayout",
"scripts": { "scripts": {
"copy": "rimraf dist && mkdir dist && cpx 'public/**/*' dist", "copy": "rimraf dist && mkdir dist && cpx 'public/**/*' dist",
"dev": "npm run copy && webpack --mode development", "dev": "npm run copy && webpack --mode=development",
"dev-server": "npm run copy && webpack-dev-server", "dev-server": "npm run copy && webpack serve",
"build": "npm run copy && webpack --mode production && npm run export", "build": "npm run copy && webpack --mode=production && npm run export",
"export": "react-snap", "export": "react-snap",
"deploy": "npm run build && netlify deploy --dir=dist --prod", "deploy": "npm run build && netlify deploy --dir=dist --prod",
"analyse": "NODE_ENV=analyse webpack --config webpack.config.js -p", "analyse": "NODE_ENV=analyse webpack --config webpack.config.js -p",
"lint": "tslint -c tslint.json -o tslint.log 'client/**/*.{ts,tsx}'" "lint": "tslint -c tslint.json -o tslint.log 'client/**/*.{ts,tsx}'"
}, },
"dependencies": { "dependencies": {
"@loadable/component": "^5.12.0", "@loadable/component": "^5.14.1",
"highlight.js": "^10.4.1", "highlight.js": "^10.7.1",
"react": "^16.12.0", "react": "^17.0.2",
"react-dom": "^16.12.0", "react-dom": "^17.0.2",
"react-helmet": "^5.2.1", "react-helmet": "^6.1.0",
"react-router-dom": "^5.1.2" "react-router-dom": "^5.2.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.8.3", "@babel/core": "^7.13.13",
"@babel/preset-env": "^7.8.3", "@babel/preset-env": "^7.13.12",
"@babel/preset-react": "^7.7.4", "@babel/preset-react": "^7.13.13",
"@loadable/babel-plugin": "^5.12.0", "@loadable/babel-plugin": "^5.13.2",
"@types/loadable__component": "^5.10.0", "@types/loadable__component": "^5.13.3",
"@types/react": "^16.9.17", "@types/react": "^17.0.3",
"@types/react-dom": "^16.9.4", "@types/react-dom": "^17.0.3",
"@types/react-helmet": "^5.0.15", "@types/react-helmet": "^6.1.0",
"@types/react-router-dom": "^5.1.3", "@types/react-router-dom": "^5.1.7",
"babel-loader": "^8.0.6", "babel-loader": "^8.2.2",
"cpx2": "^2.0.0", "cpx2": "^3.0.0",
"css-loader": "^3.4.2", "css-loader": "^5.2.0",
"html-webpack-plugin": "^3.2.0", "html-webpack-plugin": "^5.3.1",
"mini-css-extract-plugin": "^0.9.0", "mini-css-extract-plugin": "^1.4.0",
"postcss-loader": "^3.0.0", "postcss-loader": "^5.2.0",
"react-snap": "^1.23.0", "react-snap": "^1.23.0",
"rimraf": "^3.0.0", "rimraf": "^3.0.2",
"source-map-loader": "^0.2.4", "source-map-loader": "^2.0.1",
"style-loader": "^1.1.3", "style-loader": "^2.0.0",
"tailwindcss": "^1.1.4", "tailwindcss": "^1.1.4",
"ts-loader": "^6.2.1", "ts-loader": "^8.1.0",
"tslint": "^5.20.1", "tslint": "^6.1.3",
"tslint-react": "^4.1.0", "tslint-react": "^5.0.0",
"typescript": "^3.7.5", "typescript": "^4.2.3",
"webpack": "^4.41.5", "webpack": "^5.28.0",
"webpack-bundle-analyzer": "^3.6.0", "webpack-bundle-analyzer": "^4.4.0",
"webpack-cli": "^3.3.10", "webpack-cli": "^4.6.0",
"webpack-dev-server": "^3.10.1" "webpack-dev-server": "^3.11.2"
}, },
"reactSnap": { "reactSnap": {
"source": "dist", "source": "dist",

View File

@@ -24,6 +24,7 @@ if (process.env.NODE_ENV === "analyse") {
} }
module.exports = { module.exports = {
mode: process.env.NODE_ENV,
entry: { entry: {
'vendor-styles': [ 'vendor-styles': [
'./vendors/highlight.js@9.12.0/theme.min.css', './vendors/highlight.js@9.12.0/theme.min.css',
@@ -51,18 +52,17 @@ module.exports = {
use: [ use: [
{ {
loader: MiniCssExtractPlugin.loader, loader: MiniCssExtractPlugin.loader,
options: {
hmr: process.env.NODE_ENV === 'development',
},
}, },
'css-loader', 'css-loader',
{ {
loader: 'postcss-loader', loader: 'postcss-loader',
options: { options: {
ident: 'postcss', postcssOptions: {
plugins: [ ident: 'postcss',
require('tailwindcss'), plugins: [
], require('tailwindcss'),
],
}
}, },
}, },
], ],
@@ -84,41 +84,11 @@ module.exports = {
resolve: { resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'], extensions: ['.js', '.jsx', '.ts', '.tsx'],
}, },
devtool: 'cheap-module-eavl-source-map', devtool: process.env.NODE_ENV === 'production' ? false : 'source-map',
devServer: { devServer: {
contentBase: path.join(__dirname, 'dist'), contentBase: path.join(__dirname, 'dist'),
historyApiFallback: true, historyApiFallback: true,
port: 1234, port: 1234,
}, },
plugins, plugins,
// See https://webpack.js.org/guides/caching/
optimization: {
runtimeChunk: 'single',
moduleIds: 'hashed',
splitChunks: {
chunks: 'all',
maxInitialRequests: Infinity,
minSize: 0,
cacheGroups: {
vendor: {
// sync + async chunks
chunks: 'all',
name: 'vendors',
// import file path containing node_modules
test: /[\\/]node_modules[\\/]/,
priority: 20,
},
/*
common: {
name: 'common',
minChunks: 2,
chunks: 'all',
priority: 10,
reuseExistingChunk: true,
enforce: true,
},
*/
},
},
},
}; };