[sandbox] Fix bundling

This commit is contained in:
orosmatthew 2023-08-26 15:48:29 -04:00
parent 002f9bfa38
commit 432afeeefa
3 changed files with 1065 additions and 500 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4,13 +4,13 @@
"description": "The student extension for BW's HSPC", "description": "The student extension for BW's HSPC",
"version": "0.0.1", "version": "0.0.1",
"engines": { "engines": {
"vscode": "^1.78.0" "vscode": "^1.81.0"
}, },
"categories": [ "categories": [
"Other" "Other"
], ],
"activationEvents": [], "activationEvents": [],
"main": "./out/extension.js", "main": "./out/main.js",
"contributes": { "contributes": {
"configuration": { "configuration": {
"title": "BWContest", "title": "BWContest",
@ -72,43 +72,43 @@
}, },
"scripts": { "scripts": {
"vscode:prepublish": "npm run compile", "vscode:prepublish": "npm run compile",
"compile": "rollup -c && tsc -p ./", "esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node",
"watch": "concurrently \"rollup -c -w\" \"tsc -watch -p ./\"", "esbuild": "npm run esbuild-base -- --sourcemap",
"pretest": "npm run compile && npm run lint", "compile": "rollup -c && npm run esbuild-base -- --minify",
"lint": "eslint src --ext ts", "watch": "concurrently \"rollup -c -w\" \"npm run esbuild-base -- --sourcemap --watch\""
"test": "node ./out/test/runTest.js"
}, },
"devDependencies": { "devDependencies": {
"@rollup/plugin-commonjs": "^24.1.0", "@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-node-resolve": "^15.2.1", "@rollup/plugin-node-resolve": "^15.2.1",
"@rollup/plugin-terser": "^0.4.3",
"@rollup/plugin-typescript": "^11.1.3", "@rollup/plugin-typescript": "^11.1.3",
"@tsconfig/svelte": "^5.0.2", "@tsconfig/svelte": "^5.0.2",
"@types/fs-extra": "^11.0.1", "@types/fs-extra": "^11.0.1",
"@types/glob": "^8.1.0", "@types/glob": "^8.1.0",
"@types/mocha": "^10.0.1", "@types/mocha": "^10.0.1",
"@types/node": "16.x", "@types/node": "20.x",
"@types/vscode": "^1.81.0", "@types/vscode": "^1.81.0",
"@typescript-eslint/eslint-plugin": "^5.59.1", "@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^5.59.1", "@typescript-eslint/parser": "^6.4.1",
"@vscode/test-electron": "^2.3.4", "@vscode/test-electron": "^2.3.4",
"concurrently": "^8.2.1", "concurrently": "^8.2.1",
"esbuild": "^0.19.2",
"eslint": "^8.48.0", "eslint": "^8.48.0",
"glob": "^8.1.0", "glob": "^10.3.3",
"mocha": "^10.2.0", "mocha": "^10.2.0",
"postcss": "^8.4.28", "postcss": "^8.4.28",
"rollup-plugin-css-only": "^4.3.0", "rollup-plugin-css-only": "^4.3.0",
"rollup-plugin-postcss": "^4.0.2", "rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-svelte": "^7.1.6", "rollup-plugin-svelte": "^7.1.6",
"rollup-plugin-terser": "^7.0.2",
"svelte": "^4.2.0", "svelte": "^4.2.0",
"svelte-check": "^3.5.0", "svelte-check": "^3.5.0",
"svelte-preprocess": "^5.0.4", "svelte-preprocess": "^5.0.4",
"typescript": "^5.2.2" "typescript": "^5.2.2"
}, },
"dependencies": { "dependencies": {
"axios": "^1.4.0", "@vscode/vsce": "^2.20.1",
"axios": "^1.5.0",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"tree-kill": "^1.2.2", "tree-kill": "^1.2.2"
"vsce": "^2.15.0"
} }
} }

View File

@ -1,7 +1,7 @@
import svelte from "rollup-plugin-svelte"; import svelte from "rollup-plugin-svelte";
import resolve from "@rollup/plugin-node-resolve"; import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs"; import commonjs from "@rollup/plugin-commonjs";
import { terser } from "rollup-plugin-terser"; import terser from "@rollup/plugin-terser";
import sveltePreprocess from "svelte-preprocess"; import sveltePreprocess from "svelte-preprocess";
import typescript from "@rollup/plugin-typescript"; import typescript from "@rollup/plugin-typescript";
import path from "path"; import path from "path";
@ -17,7 +17,6 @@ export default fs
return { return {
input: "webviews/pages/" + input, input: "webviews/pages/" + input,
output: { output: {
sourcemap: true,
format: "iife", format: "iife",
name: "app", name: "app",
file: "out/compiled/" + name + ".js", file: "out/compiled/" + name + ".js",
@ -25,7 +24,9 @@ export default fs
plugins: [ plugins: [
svelte({ svelte({
// enable run-time checks when not in production // enable run-time checks when not in production
dev: !production, compilerOptions: {
dev: !production
},
preprocess: sveltePreprocess(), preprocess: sveltePreprocess(),
emitCss: true emitCss: true
}), }),
@ -37,7 +38,6 @@ export default fs
commonjs(), commonjs(),
typescript({ typescript({
tsconfig: "webviews/tsconfig.json", tsconfig: "webviews/tsconfig.json",
sourceMap: !production,
inlineSources: !production, inlineSources: !production,
}), }),
production && terser(), production && terser(),