Skip to content

Commit

Permalink
fix for webpack svgs
Browse files Browse the repository at this point in the history
  • Loading branch information
dzsquared committed Jan 5, 2020
1 parent 651358b commit cae6cab
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 10 deletions.
22 changes: 22 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"activationEvents": [
"*"
],
"main": "./out/extension",
"main": "./dist/extension",
"contributes": {
"commands": [
{
Expand All @@ -30,8 +30,8 @@
"command": "dsk.newqueryoption",
"title": "QE Boost: New Query",
"icon": {
"light": "src/media/newquery.svg",
"dark": "src/media/newquery-inverse.svg"
"light": "./dist/src/media/newquery.svg",
"dark": "./dist/src/media/newquery-inverse.svg"
}
},
{
Expand Down Expand Up @@ -155,6 +155,7 @@
"@types/mocha": "^2.2.42",
"@types/node": "^7.0.43",
"azdata": "1.0.0",
"file-loader": "^5.0.2",
"ts-loader": "^6.2.1",
"typescript": "^2.6.1",
"vscode": "^1.1.6",
Expand Down
3 changes: 2 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { runQuerySection } from './runQuery';
import { placeScript } from './placescript';
import { telemetryHelper } from './telemetryHelper';

// var tH: telemetryHelper;
require('./media/newquery.svg');
require('./media/newquery-inverse.svg');

export function activate(context: vscode.ExtensionContext) {
// query section execution keyboard shortcut setting
Expand Down
3 changes: 1 addition & 2 deletions src/telemetryHelper.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import * as vscode from 'vscode';

import * as telemetryConnect from './telemetryConnect';
let telemetryconnect: telemetryConnect.telemetryConnect = require('../telemetryConnect.json');

// extension telemetry
import TelemetryReporter from 'vscode-extension-telemetry';
const extensionId = 'drewsk.query-editor-boost';
const extension = vscode.extensions.getExtension(extensionId);
let telemetryconnect: telemetryConnect.telemetryConnect = require('../telemetryConnect.json');
const extensionVersion = extension.packageJSON.version;
const key = telemetryconnect.token;

Expand Down
14 changes: 10 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ const config = {
},
devtool: 'source-map',
externals: {
vscode: 'commonjs 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/
azdata: 'commonjs azdata',
applicationinsights: 'commonjs applicationinsights'
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/
azdata: 'azdata'
},
resolve: {
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
extensions: ['.ts', '.js']
extensions: ['.ts', '.js', '.svg']
},
module: {
rules: [
Expand All @@ -36,6 +35,13 @@ const config = {
loader: 'ts-loader'
}
]
},
{
test: /\.svg$/,
loader: 'file-loader',
options: {
name: '[path][name].[ext]',
}
}
]
}
Expand Down

0 comments on commit cae6cab

Please sign in to comment.