Skip to content

Commit

Permalink
migrate to webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarpunk committed Aug 11, 2023
1 parent 3e8f96c commit 24f6a9d
Show file tree
Hide file tree
Showing 18 changed files with 353 additions and 323 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"ecmaVersion": "latest",
"sourceType": "module",
"project": [
"src/tsconfig.json",
"docs/tsconfig.json"
"tsconfig.json"
]
},
"ignorePatterns": ["webpack.config.js"],
"rules": {
"curly": "off",
"semi": ["error", "never"],
Expand Down
16 changes: 7 additions & 9 deletions docs/_gen/gen.js

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

2 changes: 1 addition & 1 deletion docs/_gen/gen.js.map

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

18 changes: 8 additions & 10 deletions docs/main.js

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

2 changes: 1 addition & 1 deletion docs/main.js.map

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

12 changes: 0 additions & 12 deletions docs/tsconfig.json

This file was deleted.

10 changes: 4 additions & 6 deletions docs/wts/main.js

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

2 changes: 1 addition & 1 deletion docs/wts/main.js.map

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

18 changes: 8 additions & 10 deletions docs/zinc/main.js

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

2 changes: 1 addition & 1 deletion docs/zinc/main.js.map

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

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@
"esbuild-base": "esbuild extension=src/extension.ts slkGrid=src/slk/js/main.ts BinaryEditor=src/binary/js/main.ts --outdir=out --tsconfig=src/tsconfig.json --target=es2020 --bundle --external:vscode --external:fs --format=cjs --platform=node --tree-shaking=true --sourcemap",
"esbuild": "npm run esbuild-base",
"publish": "vsce publish patch",
"vscode:prepublish": "npm run package",
"compile": "node ./esbuild.js",
"package": "NODE_ENV=production node ./esbuild.js",
"tsc": "tsc -p ./"
"vscode:prepublish": "webpack --mode production",
"compile": "webpack --mode development"
},
"devDependencies": {
"@types/node": "^20.4.9",
Expand All @@ -49,7 +47,11 @@
"esbuild": "^0.19.0",
"eslint": "^8.46.0",
"i18next": "^23.4.4",
"typescript": "^5.1.6"
"rollup": "^3.28.0",
"ts-loader": "^9.4.4",
"typescript": "^5.1.6",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
},
"configurationDefaults": {
"jass": {
Expand Down
2 changes: 2 additions & 0 deletions src/binary/binary-editor-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ export class BinaryEditorProvider implements CustomEditorProvider<BinaryDocument

const exturi = this._context.extensionUri
const nonce = nonceGen()
const fix = 'window.module = {};'
webviewPanel.webview.html = `<!DOCTYPE html><html lang="en"><head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src ${webviewPanel.webview.cspSource} blob:; style-src ${webviewPanel.webview.cspSource}; script-src 'nonce-${nonce}';">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="${webviewPanel.webview.asWebviewUri(Uri.joinPath(exturi, 'src', 'binary', 'css', 'main.css'))}">
<script nonce="${nonce}">${fix}</script>
<script nonce="${nonce}" defer src="${webviewPanel.webview.asWebviewUri(Uri.joinPath(exturi, 'out', 'BinaryEditor.js'))}" ></script>
<title>Binary</title>
</head><body></body></html>`
Expand Down
Loading

0 comments on commit 24f6a9d

Please sign in to comment.