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

Webpack, bugfixes #64

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion .github/workflows/github-actions-vscode-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
node-version: [12.14]
os: [windows-latest, macos-latest, ubuntu-latest]
# fail-fast: false
fail-fast: false

runs-on: ${{ matrix.os }}

Expand Down
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
**/*.vsix
npm-debug.log
Expand Down
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"davidanson.vscode-markdownlint",
"vscode-icons-team.vscode-icons",
"animu5.vscode-file-header-comment",
"eamodio.tsl-problem-matcher",
"msjsdiag.debugger-for-chrome",
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
Expand Down
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "compile"
"preLaunchTask": "npm: webpack"
},
{
"name": "Launch Extension (skip views)",
Expand All @@ -28,9 +28,9 @@
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "compile - quick"
"preLaunchTask": "npm: webpack - quick"
},
{
"name": "Integration Tests",
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"reveal": "never"
},
"problemMatcher": [
"$tsc-watch"
"$ts-webpack"
]
},
{
Expand Down
5 changes: 5 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ coverage/
.nyc_output/
.github/
downloadVisJs.js

webpack.config.js
node_modules
views/.eslintrc.js

how_to_contribute.md

views/common/node_modules
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# PDDL support - What's new?

## [Unreleased]

- Faster start-up time due to migration to Webpack. Please report any errors that fell through my week of hands-on usage/testing.

## 2.20.3

### Initial state visualization
Expand Down
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"onView:pddl.tests.explorer",
"onUri"
],
"main": "./out/extension",
"main": "./dist/extension",
"contributes": {
"languages": [
{
Expand Down Expand Up @@ -988,8 +988,10 @@
"compile": "tsc -p ./ && copyfiles --flat ./src/planView/model/package.json ./out/planView/model/ && copyfiles --flat ./src/modelView/model/package.json ./out/modelView/model/ && cd views/common && npm run compile && cd ../searchview && npm run compile && cd ../planview && npm run compile && cd ../modelView && npm run compile && cd ../..",
"watch": "tsc -w -p ./",
"lint": "eslint src --ext ts",
"vscode:prepublish": "npm run compile",
"vscode:prepublish": "webpack --mode production",
"update-vscode": "node ./node_modules/vscode/bin/install",
"webpack": "webpack --mode development",
"webpack-dev": "webpack --mode development --watch",
"package": "vsce package",
"pretest": "npm run compile",
"test:unit": "mocha -- out/test/**/*Test.js && cd views/searchview && npm test && cd ../..",
Expand Down Expand Up @@ -1040,9 +1042,12 @@
"minimist": ">=0.2.1",
"mocha": "^8.2.0",
"tmp-promise": "^2.0.2",
"ts-loader": "^7.0.3",
"typescript": "^4.1.3",
"vsce": "^1.80.0",
"vscode-codicons": "0.0.12",
"vscode-test": "^1.0.0"
"vscode-test": "^1.0.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
}
}
43 changes: 43 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//@ts-check

'use strict';

const path = require('path');

/** @type {import('webpack').Configuration} */
const config = {
target: 'node',
entry: './src/extension.ts',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'extension.js',
libraryTarget: "commonjs2",
devtoolModuleFilenameTemplate: '../[resource-path]'
},
devtool: 'source-map',
externals: {
vscode: 'commonjs vscode' // todo: anything else?
},
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader',
/*options: {
compilerOptions: {
"module": "es6" // override `tsconfig.json` so that TypeScript emits native JavaScript modules.
}
}*/
}
]
}
]
}
};
module.exports = config;