webpack.config.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. const path = require('path')
  2. const webpack = require('webpack')
  3. module.exports = {
  4. target: 'node',
  5. entry: 'src/index.ts',
  6. devtool: 'source-map',
  7. context: __dirname,
  8. output: {
  9. path: path.resolve(__dirname, 'dist'),
  10. filename: 'index.js',
  11. pathinfo: true,
  12. libraryTarget: 'umd',
  13. devtoolModuleFilenameTemplate: 'webpack-terminus-terminal:///[resource-path]',
  14. },
  15. resolve: {
  16. modules: ['.', 'src', 'node_modules', '../app/node_modules'].map(x => path.join(__dirname, x)),
  17. extensions: ['.ts', '.js'],
  18. },
  19. module: {
  20. loaders: [
  21. {
  22. test: /\.ts$/,
  23. loader: 'awesome-typescript-loader',
  24. query: {
  25. configFileName: path.resolve(__dirname, 'tsconfig.json'),
  26. typeRoots: [path.resolve(__dirname, 'node_modules/@types')],
  27. paths: {
  28. "terminus-*": [path.resolve(__dirname, '../terminus-*')],
  29. "*": [path.resolve(__dirname, '../app/node_modules/*')],
  30. }
  31. }
  32. },
  33. { test: /\.pug$/, use: ['apply-loader', 'pug-loader'] },
  34. { test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] },
  35. { test: /\.css$/, use: ['to-string-loader', 'css-loader'] },
  36. ]
  37. },
  38. externals: [
  39. 'fs',
  40. 'font-manager',
  41. 'path',
  42. 'node-pty',
  43. 'mz/fs',
  44. 'mz/child_process',
  45. 'winreg',
  46. /^rxjs/,
  47. /^@angular/,
  48. /^@ng-bootstrap/,
  49. /^terminus-/,
  50. ],
  51. plugins: [
  52. new webpack.optimize.ModuleConcatenationPlugin(),
  53. ],
  54. }