webpack.config.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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-settings:///[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. options: {
  25. configFileName: path.resolve(__dirname, 'tsconfig.json'),
  26. paths: {
  27. "terminus-*": [path.resolve(__dirname, '../terminus-*')],
  28. "*": [path.resolve(__dirname, '../app/node_modules/*')],
  29. }
  30. }
  31. },
  32. { test: /\.pug$/, use: ['apply-loader', 'pug-loader'] },
  33. { test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] },
  34. { test: /\.css$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] },
  35. ]
  36. },
  37. externals: [
  38. 'fs',
  39. 'fs-promise',
  40. 'path',
  41. 'node-pty',
  42. 'fs-promise',
  43. /^rxjs/,
  44. /^@angular/,
  45. /^@ng-bootstrap/,
  46. /^terminus-/,
  47. ],
  48. plugins: [
  49. new webpack.optimize.ModuleConcatenationPlugin(),
  50. ],
  51. }