webpack.config.js 972 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. var path = require('path');
  2. var webpack = require('webpack');
  3. var UpdateVersionPlugin = require('./updateVersionPlugin');
  4. module.exports = {
  5. entry: './js/main.js',
  6. mode: 'development',
  7. watch: true,
  8. output: {
  9. path: path.resolve(__dirname, 'build'),
  10. filename: 'ivprog.bundle.js',
  11. library: 'ivprogCore',
  12. libraryTarget: 'umd'
  13. },
  14. node: {
  15. fs: 'empty',
  16. },
  17. module: {
  18. rules: [{
  19. test: /\.js$/,
  20. loader: 'babel-loader',
  21. query: {
  22. presets: ['env']
  23. }
  24. }, {
  25. test: /\.g4/,
  26. loader: 'antlr4-webpack-loader'
  27. }]
  28. },
  29. stats: {
  30. colors: true
  31. },
  32. plugins: [new UpdateVersionPlugin()],
  33. /*optimization: {
  34. splitChunks: {
  35. chunks: 'all'
  36. }
  37. },*/
  38. devtool: 'source-map',
  39. watchOptions: {
  40. ignored: path.resolve(__dirname, '.ima_version.json')
  41. }
  42. };