Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.33 KB | None | 0 0
  1. const fs = require('fs');
  2. const path = require('path');
  3. const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
  4. const CopyWebpackPlugin = require('copy-webpack-plugin');
  5. const { GlobCopyWebpackPlugin } = require('@angular/cli/plugins/webpack'); // eslint-disable-line no-unused-vars
  6. const ProgressPlugin = require('webpack/lib/ProgressPlugin');
  7. const CircularDependencyPlugin = require('circular-dependency-plugin');
  8. const HtmlWebpackPlugin = require('html-webpack-plugin');
  9. const ExtractTextPlugin = require('extract-text-webpack-plugin');
  10. const rxPaths = require('rxjs/_esm5/path-mapping');
  11. const autoprefixer = require('autoprefixer');
  12. const cssnano = require('cssnano');
  13. const { NoEmitOnErrorsPlugin, HashedModuleIdsPlugin, EnvironmentPlugin, ProvidePlugin } = require('webpack');
  14. const { BaseHrefWebpackPlugin, SuppressExtractedTextChunksWebpackPlugin } = require('@angular/cli/plugins/webpack');
  15. const { CommonsChunkPlugin, ModuleConcatenationPlugin } = require('webpack').optimize;
  16. const { PurifyPlugin } = require('@angular-devkit/build-optimizer');
  17. const { AngularCompilerPlugin } = require('@ngtools/webpack');
  18. const nodeModules = path.join(process.cwd(), 'node_modules');
  19. const realNodeModules = fs.realpathSync(nodeModules);
  20. const genDirNodeModules = path.join(process.cwd(), 'src', '$$_gendir', 'node_modules');
  21. const entryPoints = ["inline", "polyfills", "sw-register", "styles", "vendor", "main", "shop-builder"];
  22. const minimizeCss = true;
  23. const baseHref = "";
  24. const deployUrl = "";
  25. const projectRoot = process.cwd();
  26. const maximumInlineSize = 10;
  27.  
  28. module.exports = {
  29. "resolve": {
  30. "extensions": [
  31. ".ts",
  32. ".js"
  33. ],
  34. "modules": [
  35. "node_modules"
  36. ],
  37. "symlinks": true,
  38. "alias": Object.assign({
  39. '@simplicity': path.resolve(process.cwd(), "app"),
  40. }, rxPaths()),
  41. "mainFields": [
  42. "browser",
  43. "module",
  44. "core-ts"
  45. ]
  46. },
  47. devtool: 'source-map',
  48. "resolveLoader": {
  49. "modules": [
  50. "node_modules"
  51. ],
  52. "alias": Object.assign({
  53. '@simplicity': path.resolve(process.cwd(), "app"),
  54. }, rxPaths()),
  55. },
  56. "entry": {
  57. "core-ts": [
  58. path.join(process.cwd(), 'grunt/lib/compose-core-typescript')
  59. ],
  60.  
  61. },
  62. "output": {
  63. "path": path.join(process.cwd(), "temp/"),
  64. "filename": "[name].js",
  65. "chunkFilename": "[id].chunk.js",
  66. "crossOriginLoading": false,
  67. "publicPath": "/"
  68. },
  69. "module": {
  70. "rules": [
  71. {
  72. "test": /\.html$/,
  73. "loader": "raw-loader"
  74. },
  75. {
  76. "test": /\.(eot|svg|cur)$/,
  77. "loader": "file-loader",
  78. "options": {
  79. "name": "[name].[hash:20].[ext]",
  80. "limit": 10000
  81. }
  82. },
  83. {
  84. "test": /\.(jpg|png|webp|gif|otf|ttf|woff|woff2|ani)$/,
  85. "loader": "url-loader",
  86. "options": {
  87. "name": "[name].[hash:20].[ext]",
  88. "limit": 10000
  89. }
  90. },
  91. {
  92. "test": /\.js$/,
  93. "use": [
  94. {
  95. "loader": "@angular-devkit/build-optimizer/webpack-loader",
  96. "options": {
  97. "sourceMap": true
  98. }
  99. }
  100. ]
  101. },
  102. {
  103. "test": /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/,
  104. "use": [
  105. {
  106. "loader": "@angular-devkit/build-optimizer/webpack-loader",
  107. "options": {
  108. "sourceMap": true
  109. }
  110. },
  111. "@ngtools/webpack"
  112. ]
  113. }
  114. ]
  115. },
  116. "plugins": [
  117. new EnvironmentPlugin({
  118. "NODE_ENV": "development"
  119. }),
  120. /*new ProvidePlugin({
  121. jQuery: 'jquery/src/jquery',
  122. $: 'jquery/src/jquery',
  123. jquery: 'jquery/src/jquery'
  124. }),*/
  125. new NoEmitOnErrorsPlugin(),
  126. /*new GlobCopyWebpackPlugin({
  127. "patterns": [
  128. "config"
  129. ],
  130. "globOptions": {
  131. "cwd": "app/components",
  132. "dot": true,
  133. "ignore": ".gitkeep",
  134. "output": path.join(process.cwd(), "build/simplicity/apps/config")
  135. }
  136. }),*/
  137. new ProgressPlugin(),
  138. new AngularCompilerPlugin({
  139. "entryModule": 'grunt/lib/compose-core-typescript',
  140. "platform": 0,
  141. "sourceMap": true,
  142. "tsConfigPath": path.join(process.cwd(), "grunt/config/tsconfig.core.json"),
  143. "compilerOptions": {}
  144. })
  145. ],
  146. "node": {
  147. "fs": "empty",
  148. "global": true,
  149. "crypto": "empty",
  150. "tls": "empty",
  151. "net": "empty",
  152. "process": true,
  153. "module": false,
  154. "clearImmediate": false,
  155. "setImmediate": false
  156. },
  157. "devServer": {
  158. "historyApiFallback": true
  159. }
  160. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement