Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3556ede

Browse files
committed
esbuild for src extension
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent93244dc commit3556ede

File tree

10 files changed

+5460
-10
lines changed

10 files changed

+5460
-10
lines changed

‎.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build
2+
dist
3+
node_modules

‎.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ package-lock.json
99
.npmrc
1010

1111
# output directory
12-
out
1312
build
13+
dist
1414
web-app/build/
1515
web-app/node_modules
1616

‎.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
"browserslist",
1717
"codeally",
1818
"coderoad",
19+
"esbuild",
1920
"flowtype",
21+
"outfile",
2022
"packagejson",
2123
"prismjs",
2224
"Traceback",

‎.vscodeignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
.vscode-test/**
77
vsc-extension-quickstart.md
88

9-
## CI/CD
10-
.circleci
11-
129
## TypeScript
1310
**/tsconfig.json
1411
**/tslint.json

‎package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@
3131
"package":"./scripts/package.sh",
3232
"storybook":"yarn --cwd web-app storybook",
3333
"test":"jest",
34-
"watch":"tsc -watch -p ./"
34+
"esbuild-base":"esbuild ./src/extension.ts --bundle --outfile=build/extension.js --external:vscode --external:fsevents --external:jsdom --format=cjs --platform=node",
35+
"esbuild":"npm run esbuild-base -- --sourcemap",
36+
"esbuild-watch":"npm run esbuild-base -- --sourcemap --watch",
37+
"test-compile":"tsc -watch -p ./"
3538
},
3639
"dependencies": {
3740
"chokidar":"3.5.2",
@@ -56,6 +59,7 @@
5659
"@types/semver":"^7.3.9",
5760
"@typescript-eslint/eslint-plugin":"5.4.0",
5861
"@typescript-eslint/parser":"5.4.0",
62+
"esbuild":"0.14.0",
5963
"eslint-config-prettier":"8.3.0",
6064
"eslint-config-react-app":"6.0.0",
6165
"eslint-plugin-flowtype":"8.0.3",

‎scripts/build.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@ echo "Cleaning up previous build..."
88
rm -rf build
99

1010
# build extension
11-
echo"Compiling..."
12-
tsc -p ./
11+
echo"Bundling src..."
12+
npm run esbuild
1313

1414
# build web app
15+
echo"Building webapp..."
1516
cd web-app
1617
yarn build
1718
cd ..
1819

1920
# For Windows build: switch the next 2 lines
21+
echo"Bundling webapp..."
2022
if [["$OSTYPE"=="msys" ]];then
21-
echo"linux subsystem on windows selected"
23+
#linux subsystem on windows selected
2224
cp -R ./web-app/build/ ./
2325
else
24-
echo"Unix system selected"
26+
# unix
2527
cp -R ./web-app/build/. ./build/
2628
fi
2729

‎scripts/package.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ echo "Creating $OUTPUT_FILE..."
1414
echo"Building..."
1515
GENERATE_SOURCEMAP=false# reduces output size by 5mb+
1616
yarn build
17+
npm run esbuild-base -- --minify
1718

1819
echo"Packaging Extension..."
1920
mkdir -p ./$RELEASES_FOLDER

‎tsconfig.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,15 @@
2626
"allowJs":true,
2727
"removeComments":true
2828
},
29-
"exclude": ["docs","node_modules",".vscode-test","build","resources","web-app","*.js","*.test.ts","scripts"]
29+
"exclude": [
30+
"docs",
31+
"node_modules",
32+
".vscode-test",
33+
"build",
34+
"resources",
35+
"web-app",
36+
"*.js",
37+
"*.test.ts",
38+
"scripts"
39+
]
3040
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp