Skip to content

Commit

Permalink
feat: upgrade @uniquemo/mui to v0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
uniquemo committed Jun 16, 2021
1 parent e8b1070 commit d1de22d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 22 deletions.
3 changes: 0 additions & 3 deletions CODEOWNERS

This file was deleted.

16 changes: 9 additions & 7 deletions webpack.base.config.js → config/webpack.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@ import MiniCssExtractPlugin from 'mini-css-extract-plugin'
// import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
import TerserPlugin from 'terser-webpack-plugin'

const rootPath = process.cwd()

export default (env, argv) => {
const isProd = argv.mode === 'production'

const config = {
entry: './src/index.tsx',
entry: path.resolve(rootPath, 'src/index.tsx'),
output: {
// 因为开发环境中,chunkhash与HotModuleReplacementPlugin有冲突,所以两个环境分别设置
filename: isProd ? '[name].[chunkhash:8].js' : '[name].[fullhash:8].js',
path: path.resolve(__dirname, 'dist'),
path: path.resolve(rootPath, 'dist'),
publicPath: '/',
},
resolve: {
extensions: ['.tsx', '.ts', '.jsx', '.js'],
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
modules: [path.resolve(rootPath, 'src'), 'node_modules'],
alias: {
'@mui': path.resolve(__dirname, 'node_modules/@uniquemo/mui/esm/components'),
'@mui': path.resolve(rootPath, 'node_modules/@uniquemo/mui/esm/components'),
},
},
module: {
Expand All @@ -37,7 +39,7 @@ export default (env, argv) => {
libraryName: '@blueprintjs/core',
transformToDefaultImport: false,
customName: (name) => {
const BASE_PATH = `${__dirname}/node_modules/@blueprintjs/core/lib/esm`
const BASE_PATH = `${rootPath}/node_modules/@blueprintjs/core/lib/esm`

const PATH_MAP = {
button: ['button', 'buttons'],
Expand Down Expand Up @@ -88,8 +90,8 @@ export default (env, argv) => {
'process.env': '{}', // 临时修复@blueprintjs报错“process is not defined”
}),
new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'src/index.html'),
favicon: path.resolve(__dirname, 'favicon.ico'),
template: path.resolve(rootPath, 'src/index.html'),
favicon: path.resolve(rootPath, 'favicon.ico'),
}),
new MiniCssExtractPlugin({
filename: '[name].[contenthash:8].css',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "基于React、TypeScript的高仿网易云mac客户端播放器",
"main": "index.js",
"scripts": {
"dev": "node --trace-deprecation node_modules/.bin/webpack serve --mode=development",
"build": "webpack --mode=production",
"dev": "node --trace-deprecation node_modules/.bin/webpack serve --mode=development --config config/webpack.config.babel.js",
"build": "webpack --mode=production --config config/webpack.config.babel.js",
"type-check": "tsc --watch",
"lint": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
"style-lint": "stylelint 'src/**/*.css' --fix",
Expand Down Expand Up @@ -101,7 +101,7 @@
},
"dependencies": {
"@blueprintjs/core": "^3.26.0",
"@uniquemo/mui": "^0.0.2",
"@uniquemo/mui": "^0.0.3",
"axios": "^0.19.2",
"classnames": "^2.2.6",
"react": "^17.0.2",
Expand Down
6 changes: 1 addition & 5 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import '@blueprintjs/core/lib/css/blueprint.css'
import './styles/global.module.css'

const Root = () => {
return (
<div>
<App />
</div>
)
return <App />
}

const render = () => {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1285,10 +1285,10 @@
"@typescript-eslint/types" "4.6.0"
eslint-visitor-keys "^2.0.0"

"@uniquemo/mui@^0.0.2":
version "0.0.2"
resolved "https://registry.nlark.com/@uniquemo/mui/download/@uniquemo/mui-0.0.2.tgz#10ee7c0cfb2e0597def54aff41b8fd482298b227"
integrity sha1-EO58DPsuBZfe9Ur/Qbj9SCKYsic=
"@uniquemo/mui@^0.0.3":
version "0.0.3"
resolved "https://registry.nlark.com/@uniquemo/mui/download/@uniquemo/mui-0.0.3.tgz#957dd219d2d430cadbc8f487eee885755dcfb041"
integrity sha1-lX3SGdLUMMrbyPSH7uiFdV3PsEE=
dependencies:
classnames "^2.2.6"

Expand Down

0 comments on commit d1de22d

Please sign in to comment.