Guest User

Untitled

a guest
May 22nd, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.07 KB | None | 0 0
  1. {
  2. "name": "MyOrders",
  3. "private": true,
  4. "version": "0.0.0",
  5. "scripts": {
  6. "test": "karma start ClientApp/test/karma.conf.js",
  7. "webpack": "webpack"
  8. },
  9. "devDependencies": {
  10. "@angular/animations": "6.0.2",
  11. "@angular/common": "6.0.2",
  12. "@angular/compiler": "6.0.2",
  13. "@angular/compiler-cli": "^6.0.2",
  14. "@angular/core": "6.0.2",
  15. "@angular/forms": "6.0.2",
  16. "@angular/http": "6.0.2",
  17. "@angular/platform-browser": "6.0.2",
  18. "@angular/platform-browser-dynamic": "6.0.2",
  19. "@angular/platform-server": "6.0.2",
  20. "@angular/router": "6.0.2",
  21. "@ngtools/webpack": "^6.0.3",
  22. "@types/chai": "4.1.3",
  23. "@types/jasmine": "2.8.7",
  24. "@types/webpack-env": "1.13.6",
  25. "angular2-router-loader": "0.3.5",
  26. "angular2-template-loader": "0.6.2",
  27. "aspnet-prerendering": "^3.0.1",
  28. "aspnet-webpack": "^2.0.1",
  29. "awesome-typescript-loader": "5.0.0",
  30. "bootstrap": "4.1.1",
  31. "chai": "4.1.2",
  32. "chart.js": "2.7.2",
  33. "css": "2.2.3",
  34. "css-loader": "0.28.11",
  35. "es6-shim": "0.35.3",
  36. "event-source-polyfill": "0.0.12",
  37. "expose-loader": "0.7.5",
  38. "extract-text-webpack-plugin": "3.0.2",
  39. "file-loader": "1.1.11",
  40. "font-awesome": "^4.7.0",
  41. "hammerjs": "^2.0.8",
  42. "html-loader": "0.5.5",
  43. "isomorphic-fetch": "2.2.1",
  44. "jasmine-core": "3.1.0",
  45. "jquery": "3.3.1",
  46. "json-loader": "0.5.7",
  47. "karma": "2.0.2",
  48. "karma-chai": "0.1.0",
  49. "karma-chrome-launcher": "2.2.0",
  50. "karma-cli": "1.0.1",
  51. "karma-jasmine": "1.1.2",
  52. "karma-webpack": "3.0.0",
  53. "popper.js": "1.14.3",
  54. "preboot": "6.0.0-beta.4",
  55. "raw-loader": "0.5.1",
  56. "reflect-metadata": "0.1.12",
  57. "rxjs": "6.1.0",
  58. "rxjs-compat": "^6.1.0",
  59. "source-map": "^0.7.3",
  60. "style-loader": "0.21.0",
  61. "to-string-loader": "1.1.5",
  62. "typescript": "2.7.2",
  63. "uglifyjs-webpack-plugin": "^1.2.5",
  64. "url-loader": "1.0.1",
  65. "webpack": "4.8.3",
  66. "webpack-cli": "2.1.3",
  67. "webpack-hot-middleware": "2.22.2",
  68. "webpack-merge": "4.1.2",
  69. "zone.js": "0.8.26"
  70. }
  71. }
  72.  
  73. const path = require('path');
  74. const webpack = require('webpack');
  75. const merge = require('webpack-merge');
  76. const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
  77. const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin;
  78.  
  79. module.exports = (env) => {
  80. // Configuration in common to both client-side and server-side bundles
  81. const isDevBuild = !(env && env.prod);
  82. const sharedConfig = {
  83. stats: { modules: false },
  84. context: __dirname,
  85. resolve: { extensions: [ '.js', '.ts' ] },
  86. output: {
  87. filename: '[name].js',
  88. publicPath: 'dist/' // Webpack dev middleware, if enabled, handles requests for this URL prefix
  89. },
  90. module: {
  91. rules: [
  92. {
  93. "test": /.ts$/, loaders: ['@ngtools/webpack']
  94. },
  95. { test: /.html$/, use: 'html-loader?minimize=false' },
  96. { test: /.css$/, use: [ 'to-string-loader', isDevBuild ? 'css-loader' : 'css-loader?minimize' ] },
  97. { test: /.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' }
  98. ]
  99. }
  100. };
  101.  
  102. // Configuration for client-side bundle suitable for running in browsers
  103. const clientBundleOutputDir = './wwwroot/dist';
  104. const clientBundleConfig = merge(sharedConfig, {
  105. entry: { 'main-client': './ClientApp/boot.browser.ts' },
  106. output: { path: path.join(__dirname, clientBundleOutputDir) },
  107. plugins: [
  108. new webpack.DllReferencePlugin({
  109. context: __dirname,
  110. manifest: require('./wwwroot/dist/vendor-manifest.json')
  111. })
  112. ].concat(isDevBuild ? [
  113. // Plugins that apply in development builds only
  114. new webpack.SourceMapDevToolPlugin({
  115. filename: '[file].map', // Remove this line if you prefer inline source maps
  116. moduleFilenameTemplate: path.relative(clientBundleOutputDir, '[resourcePath]') // Point sourcemap entries to the original file locations on disk
  117. })
  118. ] : [
  119. // Plugins that apply in production builds only
  120. new webpack.optimize.UglifyJsPlugin(),
  121. new AngularCompilerPlugin({
  122. tsConfigPath: './tsconfig.json',
  123. entryModule: path.join(__dirname, 'ClientApp/app/app.browser.module#AppModule'),
  124. exclude: ['./**/*.server.ts']
  125. })
  126. ])
  127. });
  128.  
  129. // Configuration for server-side (prerendering) bundle suitable for running in Node
  130. const serverBundleConfig = merge(sharedConfig, {
  131. resolve: { mainFields: ['main'] },
  132. entry: { 'main-server': './ClientApp/boot.server.ts' },
  133. plugins: [
  134. new webpack.DllReferencePlugin({
  135. context: __dirname,
  136. manifest: require('./ClientApp/dist/vendor-manifest.json'),
  137. sourceType: 'commonjs2',
  138. name: './vendor'
  139. })
  140. ].concat(isDevBuild ? [] : [
  141. // Plugins that apply in production builds only
  142. new AngularCompilerPlugin({
  143. tsConfigPath: './tsconfig.json',
  144. entryModule: path.join(__dirname, 'ClientApp/app/app.server.module#AppModule')
  145. })
  146. ]),
  147. output: {
  148. libraryTarget: 'commonjs',
  149. path: path.join(__dirname, './ClientApp/dist')
  150. },
  151. target: 'node',
  152. devtool: 'inline-source-map'
  153. });
  154.  
  155. return [clientBundleConfig, serverBundleConfig];
  156. };
Add Comment
Please, Sign In to add comment