No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

41 líneas
1.4 KiB

hace 3 años
  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;