Skip to content
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
26 changes: 3 additions & 23 deletions pydance/.vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,6 @@ vsc-extension-quickstart.md
test/**
.github/**
**/*.vsix
node_modules/**/test/**
node_modules/**/tests/**
node_modules/**/spec/**
node_modules/**/example/**
node_modules/**/examples/**
node_modules/**/demo/**
node_modules/**/demos/**
node_modules/**/docs/**
node_modules/**/doc/**
node_modules/**/*.md
node_modules/**/*.markdown
node_modules/**/LICENSE*
node_modules/**/LICENCE*
node_modules/**/license*
node_modules/**/licence*
node_modules/**/.npmignore
node_modules/**/.gitignore
node_modules/**/.editorconfig
node_modules/**/.eslintrc*
node_modules/**/.prettierrc*
node_modules/**/Makefile
node_modules/**/Gulpfile.js
node_modules/**/Gruntfile.js
node_modules/**
esbuild.js
**/*.map
54 changes: 54 additions & 0 deletions pydance/esbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const esbuild = require('esbuild');

const production = process.argv.includes('--production');
const watch = process.argv.includes('--watch');

async function main() {
const ctx = await esbuild.context({
entryPoints: ['src/extension.ts'],
bundle: true,
format: 'cjs',
minify: production,
sourcemap: !production,
sourcesContent: false,
platform: 'node',
outfile: 'out/extension.js',
external: ['vscode'],
logLevel: 'info',
plugins: [
/* add to the end of plugins array */
esbuildProblemMatcherPlugin,
],
});
if (watch) {
await ctx.watch();
} else {
await ctx.rebuild();
await ctx.dispose();
}
}

/**
* @type {import('esbuild').Plugin}
*/
const esbuildProblemMatcherPlugin = {
name: 'esbuild-problem-matcher',

setup(build) {
build.onStart(() => {
console.log('[watch] build started');
});
build.onEnd((result) => {
result.errors.forEach(({ text, location }) => {
console.error(`✘ [ERROR] ${text}`);
console.error(` ${location.file}:${location.line}:${location.column}:`);
});
console.log('[watch] build finished');
});
},
};

main().catch(e => {
console.error(e);
process.exit(1);
});
Loading
Loading