Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
3c1cfabf
Commit
3c1cfabf
authored
Jul 13, 2018
by
ιεΈ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimization: chnage firebase site script
parent
e0db0d1d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
21 deletions
+43
-21
firebase.json
firebase.json
+7
-1
functions/package.json
functions/package.json
+2
-2
package.json
package.json
+1
-1
scripts/all_mock.js
scripts/all_mock.js
+32
-16
scripts/rollup.config.js
scripts/rollup.config.js
+1
-1
No files found.
firebase.json
View file @
3c1cfabf
{
"hosting"
:
{
"public"
:
"dist"
,
"rewrites"
:
[{
"source"
:
"/api/**"
,
"function"
:
"api"
}],
"rewrites"
:
[
{
"source"
:
"/api/**"
,
"function"
:
"api"
},
{
"source"
:
"**"
,
"destination"
:
"/index.html"
}
],
"ignore"
:
[
"firebase.json"
,
"**/.*"
,
"**/node_modules/**"
]
}
}
functions/package.json
View file @
3c1cfabf
...
...
@@ -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"
,
...
...
package.json
View file @
3c1cfabf
...
...
@@ -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"
,
...
...
scripts/all_mock.js
View file @
3c1cfabf
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
;
scripts/rollup.config.js
View file @
3c1cfabf
...
...
@@ -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
'
,
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment