Skip to content

Commit

Permalink
Enable local test environment for web extension
Browse files Browse the repository at this point in the history
  • Loading branch information
pderaaij committed Sep 23, 2023
1 parent 1f14bac commit 5832756
Show file tree
Hide file tree
Showing 6 changed files with 780 additions and 238 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules
.DS_Store
.vscode-test/
.vscode-test-web/
*.tsbuildinfo
*.vsix
*.log
Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"debugWebWorkerHost": true,
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionDevelopmentPath=${workspaceFolder}/packages/foam-vscode",
"--extensionDevelopmentKind=web"
],
"outFiles": ["${workspaceFolder}/dist/web/**/*.js"],
"outFiles": ["${workspaceFolder}/packages/foam-vscode/dist/web/**/*.js"],
"preLaunchTask": "npm: watch-web"
},
{
Expand Down
6 changes: 4 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
}
},
{
"label": "watch-web: foam-vscode",
"type": "npm",
"script": "watch-web",
"group": "build",
"path": "packages/foam-vscode",
"isBackground": true,
"problemMatcher": ["$ts-webpack-watch"]
"problemMatcher": [
"$ts-webpack-watch"
]
},
{
"label": "test: all packages",
Expand Down
8 changes: 5 additions & 3 deletions packages/foam-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,8 @@
"publish-extension": "yarn publish-extension-vscode && yarn publish-extension-openvsx",
"compile-web": "webpack --config web/webpack.config.js",
"watch-web": "webpack --config web/webpack.config.js --watch",
"package-web": "webpack --config web/webpack.config.js --mode production --devtool hidden-source-map"
"package-web": "webpack --config web/webpack.config.js --mode production --devtool hidden-source-map",
"open-in-browser": "vscode-test-web --browser=chromium --extensionDevelopmentPath=."
},
"devDependencies": {
"@types/dateformat": "^3.0.1",
Expand All @@ -685,6 +686,7 @@
"@types/webpack-env": "1.16.0",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"@vscode/test-web": "^0.0.45",
"crypto-browserify": "^3.12.0",
"dts-cli": "^1.6.3",
"esbuild": "^0.17.7",
Expand All @@ -707,8 +709,8 @@
"typescript": "^4.9.5",
"vscode-test": "^1.3.0",
"wait-for-expect": "^3.0.2",
"webpack": "5.38.1",
"webpack-cli": "4.7.0"
"webpack": "5.88.2",
"webpack-cli": "5.1.4"
},
"dependencies": {
"dateformat": "^3.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/foam-vscode/web/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const webExtensionConfig = {
},
output: {
filename: '[name].js',
path: path.join(__dirname, './dist/web'),
path: path.join(__dirname, './../dist/web'),
libraryTarget: 'commonjs',
devtoolModuleFilenameTemplate: '../../[resource-path]'
},
Expand Down
Loading

0 comments on commit 5832756

Please sign in to comment.