Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update default start page to included startpage/index.html #350

Merged
merged 3 commits into from
Apr 15, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

4 changes: 3 additions & 1 deletion 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,6 +565,7 @@
"@types/ws": "7.2.6",
"@typescript-eslint/eslint-plugin": "4.19.0",
"@typescript-eslint/parser": "4.19.0",
"copy-webpack-plugin": "^8.1.1",
bgoddar marked this conversation as resolved.
Show resolved Hide resolved
"eslint": "7.22.0",
"eslint-plugin-import": "^2.22.1",
bgoddar marked this conversation as resolved.
Show resolved Hide resolved
"eslint-plugin-jsdoc": "32.3.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';
bgoddar marked this conversation as resolved.
Show resolved Hide resolved
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'},
],
}),
],
},
];