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

feat: use esbuild v0.9.0 and set "logLevel" to "error" #3

Merged
merged 1 commit into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ tsconfig.json
.tags
.DS_Store
webpack.config.js
esbuild.js
yarn.lock
yarn-error.log
.github
.eslintrc.js
.prettierrc
.eslintrc.js
34 changes: 34 additions & 0 deletions esbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* eslint-disable @typescript-eslint/no-var-requires */
async function start(watch) {
await require('esbuild').build({
entryPoints: ['src/index.ts'],
bundle: true,
watch,
minify: process.env.NODE_ENV === 'production',
sourcemap: process.env.NODE_ENV === 'development',
mainFields: ['module', 'main'],
external: ['coc.nvim'],
platform: 'node',
target: 'node10.12',
outfile: 'lib/index.js',
logLevel: 'error',
});
}

let watch = false;
if (process.argv.length > 2 && process.argv[2] === '--watch') {
console.log('watching...');
watch = {
onRebuild(error) {
if (error) {
console.error('watch build failed:', error);
} else {
console.log('watch build succeeded');
}
},
};
}

start(watch).catch((e) => {
console.error(e);
});
15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"scripts": {
"lint": "eslint src --ext ts",
"clean": "rimraf lib",
"watch": "webpack --watch",
"build": "webpack",
"prepare": "npm-run-all clean build"
"watch": "node esbuild.js --watch",
"build": "node esbuild.js",
"prepare": "node esbuild.js"
},
"prettier": {
"singleQuote": true,
Expand Down Expand Up @@ -140,16 +140,13 @@
"@typescript-eslint/eslint-plugin": "^4.8.2",
"@typescript-eslint/parser": "^4.8.2",
"coc.nvim": "^0.0.80",
"esbuild": "^0.9.0",
"eslint": "^7.14.0",
"eslint-config-prettier": "^7.1.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-prettier": "^3.1.4",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.0",
"rimraf": "^3.0.2",
"ts-loader": "^8.0.11",
"typescript": "^4.1.2",
"webpack": "^5.9.0",
"webpack-cli": "^4.2.0"
"typescript": "^4.1.2"
},
"dependencies": {
"mz": "^2.7.0",
Expand Down
47 changes: 0 additions & 47 deletions webpack.config.js

This file was deleted.

Loading