Skip to content

Commit

Permalink
Use esbuild to produce a single file
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie committed Feb 6, 2022
1 parent a730083 commit f414937
Show file tree
Hide file tree
Showing 6 changed files with 165 additions and 8 deletions.
152 changes: 152 additions & 0 deletions package-lock.json

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

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"bugs": "https://github.com/asciidoctor/asciidoctor-vscode/issues",
"homepage": "https://github.com/asciidoctor/asciidoctor-vscode/blob/master/README.md",
"icon": "images/icon.png",
"main": "./out/extension.js",
"browser": "./dist/browser/extension",
"main": "./dist/src/extension.js",
"engines": {
"vscode": "^1.31.0"
"vscode": "^1.60.0"
},
"categories": [
"Programming Languages"
Expand Down Expand Up @@ -466,11 +466,14 @@
]
},
"scripts": {
"vscode:prepublish": "npm run build-ext -- --minify",
"copy-assets": "cp node_modules/@highlightjs/cdn-assets/highlight.min.js media/highlightjs && cp -r node_modules/@highlightjs/cdn-assets/languages media/highlightjs && cp -r node_modules/@highlightjs/cdn-assets/styles media/highlightjs",
"dev": "npm run build",
"build": "npm run copy-assets && npm run build-ext && npm run build-preview",
"build-web": "webpack --config extension-browser.webpack.config --mode none",
"build-preview": "webpack --config extension-preview.webpack.config --mode production",
"build-ext": "esbuild ./src/extension.ts --bundle --outfile=out/extension.js --external:vscode --format=cjs --platform=node",
"build-ext:watch": "npm run build-ext -- --sourcemap --watch",
"build-ext": "tsc -p ./",
"package": "npm run build && npm run build-web && vsce package",
"deploy": "vsce publish -p",
Expand All @@ -488,6 +491,7 @@
"@typescript-eslint/eslint-plugin": "^4.31.1",
"@typescript-eslint/parser": "^4.31.1",
"copy-webpack-plugin": "^9.0.1",
"esbuild": "^0.14.17",
"eslint": "^7.32.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/exportAsPDF.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as os from 'os'
import * as fs from 'fs'
import * as path from 'path'
import { exec, spawn } from 'child_process'
import { uuidv4 } from 'uuid'
import { v4 as uuidv4 } from 'uuid'
import * as zlib from 'zlib'
import { AsciidocEngine } from '../asciidocEngine'
import { Command } from '../commandManager'
Expand Down
2 changes: 1 addition & 1 deletion src/image-paste.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as path from 'path'
import * as vscode from 'vscode'
import { spawn } from 'child_process'
import * as moment from 'moment'
import moment from 'moment'
import * as fs from 'fs'

import { AsciidocParser } from './asciidocParser'
Expand Down
6 changes: 3 additions & 3 deletions src/test/suite/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as path from 'path'
import * as Mocha from 'mocha'
import * as glob from 'glob'
import path from 'path'
import Mocha from 'mocha'
import glob from 'glob'

export function run (): Promise<void> {
// Create the mocha test
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"compilerOptions": {
"esModuleInterop": true,
"resolveJsonModule": true,
"module": "commonjs",
"target": "es6",
"target": "es2020",
"outDir": "dist",
"lib": [
"es6",
Expand Down

0 comments on commit f414937

Please sign in to comment.