Commit 3c1cfabf authored by 陈帅's avatar 陈帅

Optimization: chnage firebase site script

parent e0db0d1d
{
"hosting": {
"public": "dist",
"rewrites": [{ "source": "/api/**", "function": "api" }],
"rewrites": [
{ "source": "/api/**", "function": "api" },
{
"source": "**",
"destination": "/index.html"
}
],
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
}
}
......@@ -2,12 +2,12 @@
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"serve": "npm run mock && firebase serve --only functions",
"serve": "firebase serve --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log",
"mock": "cd .. && rollup -c"
"mock": "cd ../scripts && rollup -c"
},
"dependencies": {
"express": "^4.16.3",
......
......@@ -9,7 +9,7 @@
"start": "cross-env ESLINT=none umi dev",
"start:no-mock": "cross-env MOCK=none ESLINT=none umi dev",
"build": "cross-env ESLINT=none umi build",
"site": "npm run presite && rollup -c && npm run build && firebase deploy",
"site": "npm run presite && npm run build && firebase deploy",
"analyze": "cross-env ANALYZE=1 umi build",
"lint:style": "stylelint \"src/**/*.less\" --syntax less",
"lint": "eslint --ext .js src mock tests && npm run lint:style",
......
import api from 'mock/api';
import chart from 'mock/chart';
import geographic from 'mock/geographic';
import notices from 'mock/notices';
import profile from 'mock/profile';
import rule from 'mock/rule';
import user from 'mock/user';
import api from '../mock/api';
import chart from '../mock/chart';
import geographic from '../mock/geographic';
import notices from '../mock/notices';
import profile from '../mock/profile';
import rule from '../mock/rule';
import user from '../mock/user';
export default {
...api,
...chart,
...geographic,
...notices,
...profile,
...rule,
...user,
};
const data = {};
Object.keys(api).forEach(key => {
data[key] = api[key];
});
Object.keys(chart).forEach(key => {
data[key] = chart[key];
});
Object.keys(geographic).forEach(key => {
data[key] = geographic[key];
});
Object.keys(notices).forEach(key => {
data[key] = notices[key];
});
Object.keys(profile).forEach(key => {
data[key] = profile[key];
});
Object.keys(rule).forEach(key => {
data[key] = rule[key];
});
Object.keys(user).forEach(key => {
data[key] = user[key];
});
export default data;
......@@ -3,7 +3,7 @@ import json from 'rollup-plugin-json';
export default {
input: './all_mock.js',
output: {
file: './functions/mock/index.js',
file: '../functions/mock/index.js',
format: 'umd',
name: 'mock',
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment