Skip to content

Commit cab7bce

Browse files
author
李操
committed
refactor_skip: change main
1 parent 77fe2ac commit cab7bce

7 files changed

+27
-26
lines changed

.eslintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
public/*
1+
dist/*
22
mock/*
33
test/*
44
tools

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
public/
1+
dist/
22
.sass-cache/
33
.idea/
44
node_modules/

package.json

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
11
{
22
"name": "@terminus/dashboard-configurator",
33
"version": "0.4.19-beta.4",
4-
"description": "Dashboard configurator with Echart",
5-
"main": "./src/index.ts",
6-
"types": "./src/types/index.d.ts",
4+
"description": "Dice Charts with Echart",
5+
"main": "./dist/index.js",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://gittar.app.terminus.io/terminus-dice/dashboard-configurator"
9+
},
10+
"keywords": [
11+
"dice",
12+
"charts",
13+
"react",
14+
"Echarts"
15+
],
716
"sideEffects": [
817
"*.scss",
918
"*.css",
1019
"*.less"
1120
],
1221
"scripts": {
1322
"prewatch": "shell/check-dll.sh",
14-
"watch": "rm -rf public/scripts && ENV=watch ./node_modules/.bin/webpack --progress --color -w -d",
23+
"watch": "rm -rf dist && ENV=watch ./node_modules/.bin/webpack --progress --color -w -d",
1524
"preweb": "shell/check-dll.sh",
16-
"web": "rm -rf public/scripts && webpack-dev-server --config webpack.server.js --mode=development",
25+
"web": "rm -rf dist && webpack-dev-server --config webpack.server.js --mode=development",
1726
"dll": "webpack --config webpack_dll.config.js --mode development",
1827
"icon": "node tools/gen-icon",
1928
"province-map": "node tools/gen-province-map",
2029
"adcode-map": "node tools/gen-adcode-map",
21-
"build": "rm -rf public && NODE_ENV=production ./node_modules/.bin/webpack --mode=production --color",
22-
"analyze": "rm -rf public && NODE_ENV=production ./node_modules/.bin/webpack --mode=production --config webpack.analyze.js",
30+
"build": "rm -rf dist && NODE_ENV=production ./node_modules/.bin/webpack --color",
31+
"analyze": "rm -rf dist && NODE_ENV=production ./node_modules/.bin/webpack --config webpack.analyze.js",
2332
"commit": "./node_modules/cz-customizable/standalone.js",
2433
"commitmsg": "commitlint -e $GIT_PARAMS",
2534
"precommit": "lint-staged",
@@ -29,17 +38,6 @@
2938
"pub-alpha": "npm version prerelease --preid alpha && npm publish --tag alpha && git push",
3039
"pub-beta": "npm version prerelease --preid beta && npm publish --tag beta && git push"
3140
},
32-
"repository": {
33-
"type": "git",
34-
"url": "https://gittar.app.terminus.io/terminus-dice/dashboard-configurator"
35-
},
36-
"keywords": [
37-
"dashboard",
38-
"configurator",
39-
"antd",
40-
"cube-state",
41-
"Echart"
42-
],
4341
"author": "terminus",
4442
"license": "ISC",
4543
"dependencies": {
@@ -139,8 +137,10 @@
139137
]
140138
},
141139
"files": [
140+
"dist",
142141
"src",
143142
"index.js",
144-
"README.md"
143+
"README.md",
144+
"package.json"
145145
]
146146
}

shell/check-dll.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
dll_file='./public/dll.js'
3+
dll_file='./dist/dll.js'
44

55
if [ -f "$dll_file" ]; then
66
echo 'dll exist😁'

webpack.config.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ module.exports = () => {
3030
node: {
3131
net: 'empty',
3232
},
33+
mode: isProd ? 'production' : 'development',
3334
entry: {
3435
index: isProd ? './src/index.ts' : './example/index.js',
3536
},
@@ -47,7 +48,7 @@ module.exports = () => {
4748
children: false,
4849
},
4950
output: {
50-
path: path.join(__dirname, '/public'),
51+
path: path.join(__dirname, '/dist'),
5152
filename: '[name].js',
5253
chunkFilename: '[id].chunk.js',
5354
publicPath: '/',
@@ -91,7 +92,7 @@ module.exports = () => {
9192
minimize: isProd,
9293
// runtimeChunk: true,
9394
namedChunks: true,
94-
// moduleIds: 'hashed',
95+
moduleIds: 'named',
9596
splitChunks: {
9697
chunks: 'all', // 必须三选一:'initial' | 'all' | 'async'
9798
minSize: 30000,

webpack.server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const devServer = {
77
port: 8010,
88
host: frontUrl,
99
compress: true,
10-
contentBase: path.join(__dirname, 'public'),
10+
contentBase: path.join(__dirname, 'dist'),
1111
index: 'index.html',
1212
open: true,
1313
noInfo: false,

webpack_dll.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const vendors = [
1212
module.exports = {
1313
entry: { vendor: vendors },
1414
output: {
15-
path: path.join(__dirname, 'public'),
15+
path: path.join(__dirname, 'dist'),
1616
filename: 'dll.js',
1717
library: '[name]_[hash]',
1818
},

0 commit comments

Comments
 (0)