Skip to content

Commit

Permalink
Bundle extension with webpack for faster startup
Browse files Browse the repository at this point in the history
  • Loading branch information
svipas committed Jun 25, 2020
1 parent 5f3690d commit 6d0326d
Show file tree
Hide file tree
Showing 7 changed files with 2,367 additions and 64 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
out
dist
node_modules
.vscode-test/
*.vsix
30 changes: 0 additions & 30 deletions .vscode/launch.json

This file was deleted.

9 changes: 5 additions & 4 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
.vscode/**
.vscode-test/**
out/test/**
out/**/*.map
images/**
out/**
node_modules/**
src/**
.gitignore
tsconfig.json
azure-pipelines.yml
images/**
tsconfig.json
webpack.config.js
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,3 @@ Install through VS Code extensions, search for `Notification Tester` by `Benas S
## Contributing

Feel free to open issues or PRs!

<details>
<summary><strong>Debug extension</strong></summary>

- Open this repository inside VS Code.
- Run `Debug: Select and Start Debugging` from command palette or open debug sidebar.
- Select `Run Extension`.

</details>
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"icon": "icon.png",
"version": "2.4.9",
"publisher": "svipas",
"main": "./dist/main.js",
"repository": {
"type": "git",
"url": "https://github.com/svipas/vscode-notification-tester.git"
Expand All @@ -29,7 +30,6 @@
"onCommand:start.progress.badge",
"onCommand:stop.progress.badge"
],
"main": "./out/main.js",
"contributes": {
"commands": [
{
Expand Down Expand Up @@ -59,12 +59,11 @@
]
},
"scripts": {
"build": "webpack --mode production",
"pretest": "tsc -p ./ && yarn build",
"test": "node ./out/test/run-test.js",
"vscode:publish": "vsce publish --yarn",
"vscode:prepublish": "yarn compile",
"compile": "tsc",
"watch": "tsc -watch",
"pretest": "yarn compile",
"test": "node ./out/test/run-test.js"
"vscode:prepublish": "yarn build"
},
"devDependencies": {
"@types/glob": "^7.1.2",
Expand All @@ -73,8 +72,11 @@
"@types/vscode": "^1.30.0",
"glob": "^7.1.6",
"mocha": "^8.0.1",
"ts-loader": "^7.0.5",
"typescript": "^3.9.5",
"vscode-test": "^1.4.0"
"vscode-test": "^1.4.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12"
},
"keywords": [
"test",
Expand Down
38 changes: 38 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const path = require("path");

/**@type {import('webpack').Configuration}*/
const config = {
target: "node",
node: {
__dirname: false, // leave the __dirname-behaviour intact
},
resolve: {
extensions: [".ts", ".js"],
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: "ts-loader",
},
],
},
],
},
externals: {
vscode: "commonjs vscode",
},
entry: "./src/main.ts",
output: {
path: path.resolve(__dirname, "dist"),
filename: "main.js",
libraryTarget: "commonjs2",
devtoolModuleFilenameTemplate: "../[resource-path]",
},
devtool: "source-map",
};

module.exports = config;
Loading

0 comments on commit 6d0326d

Please sign in to comment.