Skip to content

Commit 7bcc4bc

Browse files
committed
fix: fix qiniu uploader bugs
1 parent 7c9865e commit 7bcc4bc

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
在线示例:
88

99
* [GitHub Pages](https://yingkaixiang.github.io/vue-component-boilerplate/)
10-
* [七牛云](http://qncdn.yingkx.top/vue-component-boilerplate/index.html)
10+
* [七牛云](http://qncdn.yingkx.top/vue-component-boilerplate/index.html?id=202002062132)
1111

1212
## 特性
1313

bin/qiniu-deploy.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
const path = require('path');
22
const glob = require('glob');
3+
const mime = require('mime-types');
34

4-
const upload = require('../build/qiniu.example');
5+
const upload = require('../build/qiniu');
56

6-
const files = glob.sync('../.out/!(sb_dll|**.js.map|**.js.LICENSE)');
7+
const dirPath = path.resolve(
8+
__dirname,
9+
'../.out/!(sb_dll|**.js.map|**.js.LICENSE)',
10+
);
11+
const files = glob.sync(dirPath);
712

813
files.forEach((file) => {
914
const base = path.parse(file).base;
15+
const fileInfo = {
16+
mimeType: mime.lookup(base),
17+
};
1018
const key = `vue-component-boilerplate/${base}`;
11-
upload(file, key);
19+
upload(file, key, fileInfo);
1220
});
13-

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"build-storybook": "build-storybook -c .storybook -o .out",
1111
"deploy-local": "npm run build-storybook && http-server .out",
1212
"deploy-ghpages": "storybook-to-ghpages",
13-
"deploy-qiniu": "./bin/qiniu-deploy.js",
13+
"deploy-qiniu": "node ./bin/qiniu-deploy.js",
1414
"test": "run-s eslint jest",
1515
"jest": "jest",
1616
"generate": "./bin/generate.sh",
@@ -48,6 +48,7 @@
4848
"glob": "^7.1.6",
4949
"http-server": "^0.12.1",
5050
"jest": "^25.1.0",
51+
"mime-types": "^2.1.26",
5152
"mini-css-extract-plugin": "^0.9.0",
5253
"node-sass": "^4.13.1",
5354
"npm-run-all": "^4.1.5",

0 commit comments

Comments
 (0)