mirror of https://github.com/cloudreve/Cloudreve
chore: better way to remove frontend map files (#1380)
* Feat: better way to remove frontend map files * Feat: Docker use `GENERATE_SOURCEMAP` in the frontend build section to avoid generating map files.pull/1416/head
parent
25d56fad6e
commit
c99b36f788
|
@ -9,8 +9,10 @@ RUN git clone --recurse-submodules https://github.com/cloudreve/Cloudreve.git
|
||||||
|
|
||||||
# build frontend
|
# build frontend
|
||||||
WORKDIR /cloudreve_builder/Cloudreve/assets
|
WORKDIR /cloudreve_builder/Cloudreve/assets
|
||||||
|
ENV GENERATE_SOURCEMAP false
|
||||||
|
|
||||||
RUN yarn install --network-timeout 1000000
|
RUN yarn install --network-timeout 1000000
|
||||||
RUN yarn run build && find . -name "*.map" -type f -delete
|
RUN yarn run build
|
||||||
|
|
||||||
# build backend
|
# build backend
|
||||||
WORKDIR /cloudreve_builder/Cloudreve
|
WORKDIR /cloudreve_builder/Cloudreve
|
||||||
|
@ -39,4 +41,4 @@ RUN chmod +x ./cloudreve && mkdir -p /data/aria2 && chmod -R 766 /data/aria2
|
||||||
EXPOSE 5212
|
EXPOSE 5212
|
||||||
VOLUME ["/cloudreve/uploads", "/cloudreve/avatar", "/data"]
|
VOLUME ["/cloudreve/uploads", "/cloudreve/avatar", "/data"]
|
||||||
|
|
||||||
ENTRYPOINT ["./cloudreve"]
|
ENTRYPOINT ["./cloudreve"]
|
||||||
|
|
2
build.sh
2
build.sh
|
@ -24,13 +24,13 @@ buildAssets() {
|
||||||
rm -rf assets/build
|
rm -rf assets/build
|
||||||
|
|
||||||
export CI=false
|
export CI=false
|
||||||
|
export GENERATE_SOURCEMAP=false
|
||||||
|
|
||||||
cd $REPO/assets
|
cd $REPO/assets
|
||||||
|
|
||||||
yarn install
|
yarn install
|
||||||
yarn run build
|
yarn run build
|
||||||
cd build
|
cd build
|
||||||
find . -name "*.map" -type f -delete
|
|
||||||
cd $REPO
|
cd $REPO
|
||||||
zip -r - assets/build >assets.zip
|
zip -r - assets/build >assets.zip
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue