Skip to content

Commit 500a6af

Browse files
authored
Merge pull request #23 from dzsquared/webpack
webpack conversion
2 parents b00493c + 3aed0ca commit 500a6af

7 files changed

Lines changed: 5371 additions & 166 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ node_modules
44
*.vsix
55
secrets.txt
66
apiconfig.json
7+
dist

.vscode/launch.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"name": "Extension",
1616
"type": "sqlopsExtensionHost",
1717
"request": "launch",
18-
"runtimeExecutable": "azuredatastudio-insiders",
18+
"runtimeExecutable": "azuredatastudio",
1919
"args": [
2020
"--extensionDevelopmentPath=${workspaceFolder}"
2121
],
@@ -28,10 +28,10 @@
2828
"name": "Extension Tests",
2929
"type": "sqlopsExtensionHost",
3030
"request": "launch",
31-
"runtimeExecutable": "azuredatastudio-insiders",
31+
"runtimeExecutable": "azuredatastudio",
3232
"args": [
3333
"--extensionDevelopmentPath=${workspaceFolder}",
34-
"--extensionTestsPath=${workspaceFolder}/out/test"
34+
"--extensionTestsPath=${workspaceFolder}/dist/test"
3535
],
3636
"outFiles": [
3737
"${workspaceFolder}/out/test/**/*.js"

.vscodeignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ src/**
66
.gitignore
77
tsconfig.json
88
vsc-extension-quickstart.md
9-
tslint.json
9+
tslint.json
10+
out
11+
node_modules
12+
images

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ Can be raised here: https://github.com/dzsquared/sqlops-firstresponderkit/issues
5252

5353
## Release Notes
5454

55+
### 0.5.1
56+
57+
- Fix for changes to new editor connection changes in Azure Data Studio 1.15.0
58+
- Extension bundled with webpack
59+
5560
### 0.5.0
5661

5762
- Improvement to version check process

package-lock.json

Lines changed: 5310 additions & 159 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"activationEvents": [
1919
"*"
2020
],
21-
"main": "./out/extension",
21+
"main": "./dist/extension",
2222
"contributes": {
2323
"commands": [
2424
{
@@ -240,7 +240,9 @@
240240
]
241241
},
242242
"scripts": {
243-
"vscode:prepublish": "npm run compile",
243+
"vscode:prepublish": "webpack --mode production",
244+
"webpack": "webpack --mode development",
245+
"webpack-dev": "webpack --mode development --watch",
244246
"compile": "tsc -p ./",
245247
"watch": "tsc -watch -p ./",
246248
"postinstall": "node ./node_modules/vscode/bin/install && node ./node_modules/azdata/bin/install",
@@ -250,8 +252,11 @@
250252
"@types/mocha": "^2.2.42",
251253
"@types/node": "^7.0.43",
252254
"azdata": "^1.0.0",
255+
"ts-loader": "^6.2.1",
253256
"typescript": "^2.6.1",
254-
"vscode": "^1.1.6"
257+
"vscode": "^1.1.6",
258+
"webpack": "^4.41.6",
259+
"webpack-cli": "^3.3.11"
255260
},
256261
"dependencies": {
257262
"request": "^2.87.0",

webpack.config.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
'use strict';
2+
3+
const path = require('path');
4+
5+
/**@type {import('webpack').Configuration}*/
6+
const config = {
7+
target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
8+
9+
entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
10+
output: {
11+
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
12+
path: path.resolve(__dirname, 'dist'),
13+
filename: 'extension.js',
14+
libraryTarget: 'commonjs2',
15+
devtoolModuleFilenameTemplate: '../[resource-path]'
16+
},
17+
devtool: 'source-map',
18+
externals: {
19+
vscode: 'vscode', // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
20+
azdata: 'azdata'
21+
},
22+
resolve: {
23+
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
24+
extensions: ['.ts', '.js']
25+
},
26+
module: {
27+
rules: [
28+
{
29+
test: /\.ts$/,
30+
exclude: /node_modules/,
31+
use: [
32+
{
33+
loader: 'ts-loader'
34+
}
35+
]
36+
}
37+
]
38+
}
39+
};
40+
module.exports = config;

0 commit comments

Comments
 (0)