Replace react with preact
reduce js file bundle to 20%
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
rm -rf build
|
||||
cp -raf public build
|
||||
./node_modules/.bin/esbuild src/index.jsx --bundle --minify --outfile=build/msw-open-music.js --sourcemap
|
||||
./node_modules/.bin/esbuild src/index.jsx --bundle --outfile=build/msw-open-music.js --alias:react=preact/compat --alias:react-dom=preact/compat --minify --analyze
|
||||
cat public/index.html | sed "s/%PUBLIC_URL%/$PUBLIC_URL/" > build/index.html
|
||||
|
||||
echo "Build done, output files under ./build directory"
|
||||
|
||||
Reference in New Issue
Block a user