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

chore: add devcontainer.json #2545

Merged
merged 3 commits into from Sep 28, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions .devcontainer/devcontainer.json
@@ -0,0 +1,14 @@
{
"name": "KaTeX Codespaces",
"image": "mcr.microsoft.com/vscode/devcontainers/javascript-node:14",
"extensions": [
"dbaeumer.vscode-eslint",
"flowtype.flow-for-vscode",
"stylelint.vscode-stylelint",
"arcanis.vscode-zipfs"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this used for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevinbarabash Yarn 2 uses a zip-based file system, so this extension allows us to browse into a zip file in vscode.

],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"postCreateCommand": "git submodule update --init --recursive && CI=true yarn install"
}
2 changes: 1 addition & 1 deletion .gitpod.yml
@@ -1,6 +1,6 @@
tasks:
- init: yarn install
command: yarn start --sockPort 443
command: yarn start
- openMode: split-right
command: echo "Run 'yarn test' to run tests."

Expand Down
1 change: 1 addition & 0 deletions webpack.dev.js
Expand Up @@ -19,6 +19,7 @@ katexConfig.devServer = {
disableHostCheck: true,
host: '0.0.0.0',
port: PORT,
sockPort: 'location',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs do say anything about "location". What does this setting do?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevinbarabash It makes webpack-dev-server to use the browser's location port as the socket port: webpack/webpack-dev-server#2341. For instance, when developing locally in http://localhost:7936, it uses 7936, and using GitPod or codespaces, they are tunneled using HTTPS, so it uses 443. This eliminates the need to set --sockPort 443 manually.

stats: {
colors: true,
},
Expand Down