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.

43 lines
1.2 KiB

4 years ago
5 years ago
4 years ago
  1. const path = require('path');
  2. var webpack = require('webpack');
  3. // 1. npm i tedious node-xlsx
  4. // 2. npm run lib
  5. module.exports = [
  6. {
  7. target: "node",
  8. node: {
  9. fs: 'empty', net: 'empty', tls: 'empty',
  10. child_process: 'empty', dns: 'empty',
  11. global: true, __dirname: true
  12. },
  13. entry: {
  14. 'node-xlsx': './node_modules/node-xlsx/lib/index.js',
  15. tedious: './node_modules/tedious/lib/tedious.js',
  16. } ,
  17. output: {
  18. path: path.resolve(__dirname, 'src/bin'),
  19. filename: '[name].js',
  20. libraryTarget: 'commonjs2'
  21. },
  22. externals: {
  23. vscode: 'commonjs vscode'
  24. },
  25. resolve: {
  26. extensions: ['.ts', '.js'],
  27. alias: {
  28. '@': path.resolve(__dirname, './src'),
  29. '~': path.resolve(__dirname, './src')
  30. }
  31. },
  32. plugins: [
  33. new webpack.IgnorePlugin(/^(pg-native|supports-color|mongodb-client-encryption)$/)
  34. ],
  35. module: { rules: [{ test: /\.ts$/, exclude: /node_modules/, use: ['ts-loader'] }] },
  36. optimization: { minimize: true },
  37. watch: false,
  38. mode: 'production',
  39. devtool: false,
  40. }
  41. ];