-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from webpack to esbuild; upgrade devDependencies
- Loading branch information
1 parent
d138872
commit 0214ddd
Showing
7 changed files
with
3,087 additions
and
3,406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lib/ | ||
!.eslintrc.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as esbuild from 'esbuild'; | ||
|
||
const options = { | ||
entryPoints: ['src/index.ts'], | ||
bundle: true, | ||
minify: process.env.NODE_ENV !== 'development', | ||
sourcemap: process.env.NODE_ENV === 'development', | ||
mainFields: ['module', 'main'], | ||
external: ['coc.nvim'], | ||
platform: 'node', | ||
target: 'node16', | ||
outfile: 'lib/index.js', | ||
// https://esbuild.github.io/api/#log-level | ||
logLevel: process.env.NODE_ENV === 'development' ? 'info' : 'error', | ||
}; | ||
|
||
if (process.argv.length > 2 && process.argv[2] === '--watch') { | ||
const ctx = await esbuild.context(options); | ||
await ctx.watch(); | ||
console.log('watching...'); | ||
} else { | ||
const result = await esbuild.build(options); | ||
if (result.errors.length) { | ||
console.error(result.errors); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,22 @@ | ||
const gulp = require("gulp"); | ||
const cp = require('child_process'); | ||
const gulp = require('gulp'); // eslint-disable-line @typescript-eslint/no-var-requires | ||
const cp = require('child_process'); // eslint-disable-line @typescript-eslint/no-var-requires | ||
|
||
const server_dir = '../java-debug'; | ||
|
||
gulp.task('build_server', () => { | ||
cp.execSync(mvnw() + ' clean package', { | ||
cwd: server_dir, | ||
stdio: [0, 1, 2] | ||
stdio: [0, 1, 2], | ||
}); | ||
return gulp.src(server_dir + '/com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.*.jar') | ||
return gulp | ||
.src(server_dir + '/com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.*.jar') | ||
.pipe(gulp.dest('./server')); | ||
}); | ||
|
||
function isWin() { | ||
return /^win/.test(process.platform); | ||
} | ||
|
||
function isMac() { | ||
return /^darwin/.test(process.platform); | ||
} | ||
|
||
function isLinux() { | ||
return /^linux/.test(process.platform); | ||
} | ||
|
||
function mvnw() { | ||
return isWin() ? "mvnw.cmd" : "./mvnw"; | ||
return isWin() ? 'mvnw.cmd' : './mvnw'; | ||
} |
Oops, something went wrong.