webpack.config.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. output: {
  8. path: path.resolve(__dirname, 'build'),
  9. filename: 'ivprog.bundle.js',
  10. library: 'ivprogCore',
  11. libraryTarget: 'umd'
  12. },
  13. node: {
  14. fs: 'empty',
  15. },
  16. module: {
  17. rules: [
  18. {
  19. test: /\.js$/,
  20. exclude: /(node_modules)/,
  21. use: {
  22. loader: "babel-loader",
  23. options: {
  24. presets: ["@babel/preset-env"]
  25. }
  26. }
  27. },
  28. {
  29. test: /\.g4$/,
  30. exclude: /(node_modules)/,
  31. use: {
  32. loader:'antlr4-webpack-loader'
  33. }
  34. }
  35. ]
  36. },
  37. stats: {
  38. colors: true
  39. },
  40. plugins: [new UpdateVersionPlugin()],
  41. /*optimization: {
  42. splitChunks: {
  43. chunks: 'all'
  44. }
  45. },*/
  46. devtool: 'source-map',
  47. watchOptions: {
  48. ignored: path.resolve(__dirname, '.ima_version.json')
  49. }
  50. };