You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
896 B

  1. 'use strict';
  2. const path = require('path');
  3. const nodeExternals = require('webpack-node-externals');
  4. module.exports = function(env, argv) {
  5. env = env || {};
  6. const production = !!env.production;
  7. return {
  8. entry: './src/extension.ts',
  9. mode: production ? 'production' : 'development',
  10. target: 'node',
  11. devtool: !production ? 'eval-source-map' : undefined,
  12. output: {
  13. libraryTarget: 'commonjs2',
  14. filename: 'extension.js',
  15. path: path.resolve(__dirname, 'out')
  16. },
  17. resolve: {
  18. extensions: ['.tsx', '.ts', '.js']
  19. },
  20. externals: [nodeExternals()],
  21. module: {
  22. rules: [
  23. {
  24. test: /\.tsx?$/,
  25. use: 'ts-loader',
  26. exclude: /node_modules/
  27. }
  28. ]
  29. }
  30. };
  31. };