webpack.monaco.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. const path = require('path');
  2. const webpack = require('webpack');
  3. const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
  4. module.exports = {
  5. // output: {
  6. // filename: 'monaco.min.js',
  7. // path: path.resolve(__dirname, 'dist'),
  8. // libraryTarget: 'umd',
  9. // library: 'monaco',
  10. // globalObject: 'self'
  11. // },
  12. entry: {
  13. // monaco: './public/app/plugins/datasource/grafana-azure-monitor-datasource/monaco/monaco-loader.ts',
  14. },
  15. output: {
  16. // filename: 'monaco.min.js',
  17. // chunkFilename: '[name].bundle.js',
  18. globalObject: 'self',
  19. },
  20. resolveLoader: {
  21. alias: {
  22. 'blob-url-loader': require.resolve('./loaders/blobUrl'),
  23. 'compile-loader': require.resolve('./loaders/compile'),
  24. },
  25. },
  26. module: {
  27. rules: [
  28. {
  29. test: /\.css$/,
  30. use: [ 'style-loader', 'css-loader' ]
  31. },
  32. // {
  33. // // https://github.com/bridgedotnet/Bridge/issues/3097
  34. // test: /bridge\.js$/,
  35. // loader: 'regexp-replace-loader',
  36. // options: {
  37. // match: {
  38. // pattern: "globals\\.System\\s=\\s\\{\\};"
  39. // },
  40. // replaceWith: "$& System = globals.System; "
  41. // }
  42. // },
  43. // {
  44. // test: /Kusto\.JavaScript\.Client\.js$/,
  45. // loader: 'regexp-replace-loader',
  46. // options: {
  47. // match: {
  48. // pattern: '"use strict";'
  49. // },
  50. // replaceWith: "$& System = globals.System; "
  51. // }
  52. // },
  53. // {
  54. // test: /Kusto\.Language\.Bridge\.js$/,
  55. // loader: 'regexp-replace-loader',
  56. // options: {
  57. // match: {
  58. // pattern: '"use strict";'
  59. // },
  60. // replaceWith: "$& System = globals.System; "
  61. // }
  62. // },
  63. // {
  64. // test: /newtonsoft\.json\.js$/,
  65. // loader: 'regexp-replace-loader',
  66. // options: {
  67. // match: {
  68. // pattern: '"use strict";'
  69. // },
  70. // replaceWith: "$& System = globals.System; "
  71. // }
  72. // },
  73. // {
  74. // test: /monaco\.contribution\.js$/,
  75. // loader: 'regexp-replace-loader',
  76. // options: {
  77. // match: {
  78. // pattern: 'vs/language/kusto/kustoMode',
  79. // flags: 'g'
  80. // },
  81. // replaceWith: "./kustoMode"
  82. // }
  83. // },
  84. ]
  85. },
  86. optimization: {
  87. splitChunks: {
  88. // chunks: 'all',
  89. cacheGroups: {
  90. // monacoContribution: {
  91. // test: /(src)|(node_modules(?!\/@kusto))/,
  92. // name: 'monaco.contribution',
  93. // enforce: false,
  94. // // chunks: 'all',
  95. // },
  96. // bridge: {
  97. // test: /bridge/,
  98. // name: 'bridge',
  99. // chunks: 'all',
  100. // },
  101. // KustoJavaScriptClient: {
  102. // test: /Kusto\.JavaScript\.Client/,
  103. // name: 'kusto.javaScript.client',
  104. // chunks: 'all',
  105. // },
  106. // KustoLanguageBridge: {
  107. // test: /Kusto\.Language\.Bridge/,
  108. // name: 'kusto.language.bridge',
  109. // chunks: 'all',
  110. // },
  111. }
  112. }
  113. },
  114. plugins: [
  115. new webpack.IgnorePlugin(/^((fs)|(path)|(os)|(crypto)|(source-map-support))$/, /vs\/language\/typescript\/lib/),
  116. // new webpack.optimize.LimitChunkCountPlugin({
  117. // maxChunks: 1,
  118. // }),
  119. // new UglifyJSPlugin()
  120. ],
  121. };