Skip to content

Commit

Permalink
Update default start page to included startpage/index.html (#350)
Browse files Browse the repository at this point in the history
* update default start page to included startpage/index.html

* pr feedback
  • Loading branch information
bgoddar authored Apr 15, 2021
1 parent ab0c7a9 commit adc5017
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 54 deletions.
95 changes: 95 additions & 0 deletions package-lock.json

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

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
},
"vscode-edge-devtools.defaultUrl": {
"type": "string",
"default": "about:blank",
"default": "",
"description": "The default url to open when launching the browser without a target"
},
"vscode-edge-devtools.userDataDir": {
Expand Down Expand Up @@ -556,6 +556,7 @@
},
"devDependencies": {
"@opentelemetry/tracing": "0.18.0",
"@types/copy-webpack-plugin": "^6.4.1",
"@types/fs-extra": "9.0.8",
"@types/jest": "26.0.13",
"@types/node": "14.6.3",
Expand All @@ -564,8 +565,9 @@
"@types/ws": "7.2.6",
"@typescript-eslint/eslint-plugin": "4.19.0",
"@typescript-eslint/parser": "4.19.0",
"copy-webpack-plugin": "8.1.1",
"eslint": "7.22.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsdoc": "32.3.0",
"eslint-plugin-prefer-arrow": "1.2.3",
"fs-extra": "9.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const SETTINGS_STORE_NAME = 'vscode-edge-devtools';
export const SETTINGS_DEFAULT_USE_HTTPS = false;
export const SETTINGS_DEFAULT_HOSTNAME = 'localhost';
export const SETTINGS_DEFAULT_PORT = 9222;
export const SETTINGS_DEFAULT_URL = 'about:blank';
export const SETTINGS_DEFAULT_URL = path.resolve(path.join(__dirname, 'startpage', 'index.html'));
export const SETTINGS_WEBVIEW_NAME = 'Edge DevTools';
export const SETTINGS_PREF_NAME = 'devtools-preferences';
export const SETTINGS_PREF_DEFAULTS = {
Expand Down
112 changes: 61 additions & 51 deletions webpack.config.ts
Original file line number Diff line number Diff line change
@@ -1,51 +1,61 @@
import path from 'path';

const commonConfig = {
devtool: 'source-map',
mode: 'development',
module: {
rules: [
{
exclude: /node_modules/,
test: /\.tsx?$/,
use: 'ts-loader',
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
};

module.exports = [
{
...commonConfig,
entry: {
host: './src/host/mainHost.ts',
messaging: './src/host/mainMessaging.ts',
},
name: 'host',
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'out/host'),
},
},
{
...commonConfig,
entry: {
extension: './src/extension.ts',
},
externals: {
vscode: 'commonjs vscode',
},
name: 'extension',
output: {
devtoolModuleFilenameTemplate: '../[resource-path]',
filename: '[name].js',
libraryTarget: 'commonjs2',
path: path.resolve(__dirname, 'out'),
},
stats: 'errors-only', // Bug ws package includes dev-dependencies which webpack will report as warnings
target: 'node',
},
];
import copyPlugin from 'copy-webpack-plugin';
import path from 'path';

const commonConfig = {
devtool: 'source-map',
mode: 'development',
module: {
rules: [
{
exclude: /node_modules/,
test: /\.tsx?$/,
use: 'ts-loader',
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
};

module.exports = [
{
...commonConfig,
entry: {
host: './src/host/mainHost.ts',
messaging: './src/host/mainMessaging.ts',
},
name: 'host',
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'out/host'),
},
},
{
...commonConfig,
entry: {
extension: './src/extension.ts',
},
externals: {
vscode: 'commonjs vscode',
},
name: 'extension',
output: {
devtoolModuleFilenameTemplate: '../[resource-path]',
filename: '[name].js',
libraryTarget: 'commonjs2',
path: path.resolve(__dirname, 'out'),
},
stats: 'errors-only', // Bug ws package includes dev-dependencies which webpack will report as warnings
target: 'node',
// Copy startpage html to output bundle
plugins: [
new copyPlugin({
patterns: [
{ from: 'startpage', to: 'startpage'},
{ from: 'icon.png', to: 'icon.png'},
],
}),
],
},
];

0 comments on commit adc5017

Please sign in to comment.