Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

41 rinda
1.4 KiB

pirms 3 gadiem
  1. //@ts-check
  2. 'use strict';
  3. const path = require('path');
  4. /**@type {import('webpack').Configuration}*/
  5. const config = {
  6. target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
  7. mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
  8. entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
  9. output: {
  10. // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
  11. path: path.resolve(__dirname, '..', 'dist'),
  12. filename: 'extension.js',
  13. libraryTarget: 'commonjs2',
  14. devtoolModuleFilenameTemplate: '../[resource-path]'
  15. },
  16. devtool: 'source-map',
  17. externals: {
  18. vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
  19. },
  20. resolve: {
  21. // support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
  22. extensions: ['.ts', '.js']
  23. },
  24. module: {
  25. rules: [
  26. {
  27. test: /\.ts$/,
  28. exclude: /node_modules/,
  29. use: [
  30. {
  31. loader: 'ts-loader'
  32. }
  33. ]
  34. }
  35. ]
  36. }
  37. };
  38. module.exports = config;