webpack.config.js 1017 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. const path = require('path')
  2. // `CheckerPlugin` is optional. Use it if you want async error reporting.
  3. // We need this plugin to detect a `--watch` mode. It may be removed later
  4. // after https://github.com/webpack/webpack/issues/3460 will be resolved.
  5. const { CheckerPlugin } = require('awesome-typescript-loader')
  6. module.exports = {
  7. entry: './src/main.ts',
  8. resolve: {
  9. extensions: ['.ts', '.js'],
  10. alias: {
  11. // use our slimmed down version
  12. // still need to npm-install the original though, for typescript transpiler
  13. tslib: path.resolve(__dirname, 'src/tslib-lite.js')
  14. }
  15. },
  16. module: {
  17. loaders: [
  18. {
  19. test: /\.ts$/,
  20. loader: 'awesome-typescript-loader'
  21. }
  22. ]
  23. },
  24. plugins: [
  25. new CheckerPlugin()
  26. ],
  27. externals: {
  28. jquery: {
  29. commonjs: 'jquery',
  30. commonjs2: 'jquery', // ?, needed
  31. amd: 'jquery',
  32. root: 'jQuery' // on the window
  33. },
  34. moment: 'moment'
  35. },
  36. output: {
  37. libraryTarget: 'umd',
  38. filename: 'fullcalendar.js',
  39. path: path.resolve(__dirname, 'dist/')
  40. }
  41. };