Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.55 KB | None | 0 0
  1. {
  2. "name": "spa-stay-mgmt",
  3. "version": "0.0.0",
  4. "license": "MIT",
  5. "scripts": {
  6. "ng": "ng",
  7. "lint": "ng lint",
  8. "pree2e": "webdriver-manager update --standalone false --gecko false --quiet",
  9. "build": "webpack",
  10. "start": "mvn clean spring-boot:run",
  11. "test": "karma start ./karma.conf.js --code-coverage",
  12. "e2e": "protractor ./protractor.conf.js",
  13. "watch": "webpack --watch --progress"
  14. },
  15. "private": true,
  16. "dependencies": {
  17. "@angular/animations": "^4.4.6",
  18. "@angular/common": "^4.4.6",
  19. "@angular/compiler": "^4.4.6",
  20. "@angular/core": "^4.4.6",
  21. "@angular/forms": "^4.4.6",
  22. "@angular/http": "^4.4.6",
  23. "@angular/platform-browser": "^4.4.6",
  24. "@angular/platform-browser-dynamic": "^4.4.6",
  25. "@angular/router": "^4.4.6",
  26. "angular2-uuid": "^1.1.1",
  27. "core-js": "^2.4.1",
  28. "enquire.js": "^2.1.6",
  29. "ng2-device-detector": "^1.0.0",
  30. "ng2-redux": "^5.1.2",
  31. "ng2-simple-timer": "^1.3.3",
  32. "ngx-cookie-service": "^1.0.9",
  33. "redux": "^3.7.2",
  34. "redux-devtools-extension": "^2.13.2",
  35. "redux-ui-router": "^0.7.2",
  36. "rxjs": "^5.1.0",
  37. "urijs": "^1.18.12",
  38. "zone.js": "^0.8.14"
  39. },
  40. "devDependencies": {
  41. "@angular/cli": "1.2.0",
  42. "@angular/compiler-cli": "^4.0.0",
  43. "@angular/language-service": "^4.0.0",
  44. "@types/jasmine": "~2.5.53",
  45. "@types/jasminewd2": "~2.0.2",
  46. "@types/node": "~6.0.60",
  47. "angular-in-memory-web-api": "^0.3.2",
  48. "autoprefixer": "^6.5.3",
  49. "clean-webpack-plugin": "^0.1.16",
  50. "codelyzer": "~3.0.1",
  51. "copy-webpack-plugin": "^4.0.1",
  52. "css-loader": "^0.28.1",
  53. "cssnano": "^3.10.0",
  54. "exports-loader": "^0.6.3",
  55. "extract-text-webpack-plugin": "^3.0.0",
  56. "file-loader": "^0.10.0",
  57. "istanbul-instrumenter-loader": "^2.0.0",
  58. "jasmine-core": "~2.6.2",
  59. "jasmine-node": "^1.14.5",
  60. "jasmine-spec-reporter": "~4.1.0",
  61. "json-loader": "^0.5.4",
  62. "karma": "~1.7.0",
  63. "karma-chrome-launcher": "~2.1.1",
  64. "karma-cli": "~1.0.1",
  65. "karma-coverage-istanbul-reporter": "^1.2.1",
  66. "karma-jasmine": "~1.1.0",
  67. "karma-jasmine-html-reporter": "^0.2.2",
  68. "karma-phantomjs-launcher": "^1.0.4",
  69. "less-loader": "^4.0.2",
  70. "node-sass": "^4.5.3",
  71. "phantomjs-prebuilt": "^2.1.14",
  72. "postcss-loader": "^1.3.3",
  73. "postcss-rtl": "^0.5.10",
  74. "postcss-url": "^5.1.2",
  75. "protractor": "~5.1.2",
  76. "raw-loader": "^0.5.1",
  77. "sass-lint": "^1.10.2",
  78. "sass-loader": "^6.0.3",
  79. "script-loader": "^0.7.0",
  80. "source-map-loader": "^0.2.0",
  81. "style-loader": "^0.13.1",
  82. "stylus-loader": "^3.0.1",
  83. "ts-node": "~3.0.4",
  84. "tslint": "~5.3.2",
  85. "typescript": "~2.3.3",
  86. "url-loader": "^0.5.7",
  87. "webpack": "^3.4.1",
  88. "webpack-dev-server": "^2.6.1"
  89. },
  90. "browserslist": [
  91. "> 1%",
  92. "last 2 versions"
  93. ]
  94. }
  95.  
  96. module.exports = function (config) {
  97. config.set({
  98. basePath: '',
  99. frameworks: ['jasmine', '@angular/cli'],
  100. plugins: [
  101. require('karma-jasmine'),
  102. require('karma-chrome-launcher'),
  103. require('karma-jasmine-html-reporter'),
  104. require('karma-coverage-istanbul-reporter'),
  105. require('@angular/cli/plugins/karma')
  106. ],
  107. client:{
  108. clearContext: false, // leave Jasmine Spec Runner output visible in browser
  109. captureConsole: true
  110. },
  111. coverageIstanbulReporter: {
  112. reports: [ 'html', 'lcovonly' ],
  113. fixWebpackSourcePaths: true,
  114. dir: '%browser%',
  115. // enforce percentage thresholds
  116. // anything under these percentages will cause karma to fail with an exit code of 1 if not running in watch mode
  117. thresholds: {
  118. emitWarning: false, // set to `true` to not fail the test command when thresholds are not met
  119. global: { // thresholds for all files
  120. statements: 100,
  121. lines: 100,
  122. branches: 100,
  123. functions: 100
  124. },
  125. each: { // thresholds per file
  126. statements: 100,
  127. lines: 100,
  128. branches: 100,
  129. functions: 100
  130. }
  131. }
  132. },
  133. angularCli: {
  134. environment: 'dev'
  135. },
  136. reporters: ['progress', 'kjhtml', 'coverage-istanbul'],
  137. port: 9876,
  138. colors: true,
  139. logLevel: config.LOG_INFO,
  140. autoWatch: true,
  141. browsers: ['Chrome'],
  142. singleRun: false,
  143. concurrency: Infinity,
  144. files:[
  145. { pattern: 'src/main/webapp/stay-mgmt/app/**/*.spec.ts', watched: false }
  146. ]
  147. });
  148. };
  149.  
  150. const fs = require('fs');
  151. const path = require('path');
  152. const ProgressPlugin = require('webpack/lib/ProgressPlugin');
  153. const HtmlWebpackPlugin = require('html-webpack-plugin');
  154. const autoprefixer = require('autoprefixer');
  155. const postcssUrl = require('postcss-url');
  156. const cssnano = require('cssnano');
  157.  
  158. const rtl = require('postcss-rtl');
  159. const CleanWebpackPlugin = require('clean-webpack-plugin');
  160. const CopyWebpackPlugin = require('copy-webpack-plugin');
  161. const { NoEmitOnErrorsPlugin, SourceMapDevToolPlugin, NamedModulesPlugin } = require('webpack');
  162. const { GlobCopyWebpackPlugin, BaseHrefWebpackPlugin } = require('@angular/cli/plugins/webpack');
  163. const { CommonsChunkPlugin } = require('webpack').optimize;
  164. const { AotPlugin } = require('@ngtools/webpack');
  165.  
  166. const nodeModules = path.join(process.cwd(), 'node_modules');
  167. const realNodeModules = fs.realpathSync(nodeModules);
  168. const genDirNodeModules = path.join(process.cwd(), 'src/main/webapp/stay-mgmt', '$$_gendir', 'node_modules');
  169. const entryPoints = ["inline","polyfills","sw-register","styles","vendor","main"];
  170. const minimizeCss = true;
  171. const baseHref = "";
  172. const deployUrl = "";
  173. const postcssPlugins = function () {
  174. // safe settings based on: https://github.com/ben-eb/cssnano/issues/358#issuecomment-283696193
  175. const importantCommentRe = /@preserve|@license|[@#]s*source(?:Mapping)?URL|^!/i;
  176. const minimizeOptions = {
  177. autoprefixer: true,
  178. safe: true,
  179. mergeLonghand: false,
  180. discardComments: { remove: (comment) => !importantCommentRe.test(comment) }
  181. };
  182. return [
  183. postcssUrl({
  184. url: (URL) => {
  185. // Only convert root relative URLs, which CSS-Loader won't process into require().
  186. if (!URL.startsWith('/') || URL.startsWith('//')) {
  187. return URL;
  188. }
  189. if (deployUrl.match(/:///)) {
  190. // If deployUrl contains a scheme, ignore baseHref use deployUrl as is.
  191. return `${deployUrl.replace(//$/, '')}${URL}`;
  192. }
  193. else if (baseHref.match(/:///)) {
  194. // If baseHref contains a scheme, include it as is.
  195. return baseHref.replace(//$/, '') +
  196. `/${deployUrl}/${URL}`.replace(///+/g, '/');
  197. }
  198. else {
  199. // Join together base-href, deploy-url and the original URL.
  200. // Also dedupe multiple slashes into single ones.
  201. return `/${baseHref}/${deployUrl}/${URL}`.replace(///+/g, '/');
  202. }
  203. }
  204. }),
  205. //rtl(),
  206. autoprefixer(),
  207. ].concat(minimizeCss ? [cssnano(minimizeOptions)] : []);
  208. };
  209.  
  210. module.exports = {
  211. "resolve": {
  212. "extensions": [
  213. ".ts",
  214. ".js"
  215. ],
  216. "modules": [
  217. "./node_modules",
  218. "./node_modules"
  219. ],
  220. "symlinks": true
  221. },
  222. "resolveLoader": {
  223. "modules": [
  224. "./node_modules",
  225. "./node_modules"
  226. ]
  227. },
  228. "entry": {
  229. "main": [
  230. "./src/main/webapp/stay-mgmt/main.ts"
  231. ],
  232. "polyfills": [
  233. "./src/main/webapp/stay-mgmt/polyfills.ts"
  234. ],
  235. "styles": [
  236. "./src/main/webapp/stay-mgmt/style/styles.scss"
  237. ]
  238. },
  239. "output": {
  240. "path": path.join(process.cwd(), "./src/main/webapp/stay-mgmt/dist"),
  241. "filename": "[name].bundle.js",
  242. "chunkFilename": "[id].chunk.js"
  243. },
  244. "module": {
  245. "rules": [
  246. {
  247. "enforce": "pre",
  248. "test": /.js$/,
  249. "loader": "source-map-loader",
  250. "exclude": [
  251. //node_modules//
  252. ]
  253. },
  254. {
  255. "test": /.json$/,
  256. "loader": "json-loader"
  257. },
  258. {
  259. "test": /.html$/,
  260. "loader": "raw-loader"
  261. },
  262. {
  263. "test": /.(eot|svg)$/,
  264. "loader": "file-loader?name=[name].[hash:20].[ext]"
  265. },
  266. {
  267. "test": /.(jpg|png|webp|gif|otf|ttf|woff|woff2|cur|ani)$/,
  268. "loader": "url-loader?name=[name].[hash:20].[ext]&limit=10000"
  269. },
  270. {
  271. "exclude": [
  272. path.join(process.cwd(), "src/main/webapp/stay-mgmt/style/styles.scss")
  273. ],
  274. "test": /.css$/,
  275. "use": [
  276. "exports-loader?module.exports.toString()",
  277. {
  278. "loader": "css-loader",
  279. "options": {
  280. "sourceMap": false,
  281. "importLoaders": 1
  282. }
  283. },
  284. {
  285. "loader": "postcss-loader",
  286. "options": {
  287. "ident": "postcss",
  288. "plugins": postcssPlugins
  289. }
  290. }
  291. ]
  292. },
  293. {
  294. "exclude": [
  295. path.join(process.cwd(), "src/main/webapp/stay-mgmt/style/styles.scss")
  296. ],
  297. "test": /.scss$|.sass$/,
  298. "use": [
  299. "exports-loader?module.exports.toString()",
  300. {
  301. "loader": "css-loader",
  302. "options": {
  303. "sourceMap": false,
  304. "importLoaders": 1
  305. }
  306. },
  307. {
  308. "loader": "postcss-loader",
  309. "options": {
  310. "ident": "postcss",
  311. "plugins": postcssPlugins
  312. }
  313. },
  314. {
  315. "loader": "sass-loader",
  316. "options": {
  317. "sourceMap": false,
  318. "precision": 8,
  319. "includePaths": []
  320. }
  321. }
  322. ]
  323. },
  324. {
  325. "exclude": [
  326. path.join(process.cwd(), "src/main/webapp/stay-mgmt/style/styles.scss")
  327. ],
  328. "test": /.less$/,
  329. "use": [
  330. "exports-loader?module.exports.toString()",
  331. {
  332. "loader": "css-loader",
  333. "options": {
  334. "sourceMap": false,
  335. "importLoaders": 1
  336. }
  337. },
  338. {
  339. "loader": "postcss-loader",
  340. "options": {
  341. "ident": "postcss",
  342. "plugins": postcssPlugins
  343. }
  344. },
  345. {
  346. "loader": "less-loader",
  347. "options": {
  348. "sourceMap": false
  349. }
  350. }
  351. ]
  352. },
  353. {
  354. "exclude": [
  355. path.join(process.cwd(), "src/main/webapp/stay-mgmt/style/styles.scss")
  356. ],
  357. "test": /.styl$/,
  358. "use": [
  359. "exports-loader?module.exports.toString()",
  360. {
  361. "loader": "css-loader",
  362. "options": {
  363. "sourceMap": false,
  364. "importLoaders": 1
  365. }
  366. },
  367. {
  368. "loader": "postcss-loader",
  369. "options": {
  370. "ident": "postcss",
  371. "plugins": postcssPlugins
  372. }
  373. },
  374. {
  375. "loader": "stylus-loader",
  376. "options": {
  377. "sourceMap": false,
  378. "paths": []
  379. }
  380. }
  381. ]
  382. },
  383. {
  384. "include": [
  385. path.join(process.cwd(), "src/main/webapp/stay-mgmt/style/styles.scss")
  386. ],
  387. "test": /.css$/,
  388. "use": [
  389. "style-loader",
  390. {
  391. "loader": "css-loader",
  392. "options": {
  393. "sourceMap": false,
  394. "importLoaders": 1
  395. }
  396. },
  397. {
  398. "loader": "postcss-loader",
  399. "options": {
  400. "ident": "postcss",
  401. "plugins": postcssPlugins
  402. }
  403. }
  404. ]
  405. },
  406. {
  407. "include": [
  408. path.join(process.cwd(), "src/main/webapp/stay-mgmt/style/styles.scss")
  409. ],
  410. "test": /.scss$|.sass$/,
  411. "use": [
  412. "style-loader",
  413. {
  414. "loader": "css-loader",
  415. "options": {
  416. "sourceMap": false,
  417. "importLoaders": 1
  418. }
  419. },
  420. {
  421. "loader": "postcss-loader",
  422. "options": {
  423. "ident": "postcss",
  424. "plugins": postcssPlugins
  425. }
  426. },
  427. {
  428. "loader": "sass-loader",
  429. "options": {
  430. "sourceMap": false,
  431. "precision": 8,
  432. "includePaths": []
  433. }
  434. }
  435. ]
  436. },
  437. {
  438. "include": [
  439. path.join(process.cwd(), "src/main/webapp/stay-mgmt/style/styles.scss")
  440. ],
  441. "test": /.less$/,
  442. "use": [
  443. "style-loader",
  444. {
  445. "loader": "css-loader",
  446. "options": {
  447. "sourceMap": false,
  448. "importLoaders": 1
  449. }
  450. },
  451. {
  452. "loader": "postcss-loader",
  453. "options": {
  454. "ident": "postcss",
  455. "plugins": postcssPlugins
  456. }
  457. },
  458. {
  459. "loader": "less-loader",
  460. "options": {
  461. "sourceMap": false
  462. }
  463. }
  464. ]
  465. },
  466. {
  467. "include": [
  468. path.join(process.cwd(), "src/main/webapp/stay-mgmt/style/styles.scss")
  469. ],
  470. "test": /.styl$/,
  471. "use": [
  472. "style-loader",
  473. {
  474. "loader": "css-loader",
  475. "options": {
  476. "sourceMap": false,
  477. "importLoaders": 1
  478. }
  479. },
  480. {
  481. "loader": "postcss-loader",
  482. "options": {
  483. "ident": "postcss",
  484. "plugins": postcssPlugins
  485. }
  486. },
  487. {
  488. "loader": "stylus-loader",
  489. "options": {
  490. "sourceMap": false,
  491. "paths": []
  492. }
  493. }
  494. ]
  495. },
  496. {
  497. "test": /.ts$/,
  498. "loader": "@ngtools/webpack"
  499. }
  500. ]
  501. },
  502. "plugins": [
  503. new CleanWebpackPlugin(['src/main/webapp/stay-mgmt/dist']),
  504. new CopyWebpackPlugin([
  505. { from: "src/main/resources/adrum/", to: "adrum/" },
  506. { from: "src/main/resources/translations/", to: 'translations/' }
  507. ]),
  508. new NoEmitOnErrorsPlugin(),
  509. new GlobCopyWebpackPlugin({
  510. "patterns": [
  511. "assets",
  512. "favicon.ico"
  513. ],
  514. "globOptions": {
  515. "cwd": path.join(process.cwd(), "src/main/webapp/stay-mgmt"),
  516. "dot": true,
  517. "ignore": "**/.gitkeep"
  518. }
  519. }),
  520. new ProgressPlugin(),
  521. new SourceMapDevToolPlugin({
  522. "filename": "[file].map[query]",
  523. "moduleFilenameTemplate": "[resource-path]",
  524. "fallbackModuleFilenameTemplate": "[resource-path]?[hash]",
  525. "sourceRoot": "webpack:///"
  526. }),
  527. new HtmlWebpackPlugin({
  528. "template": "src/main/webapp/stay-mgmt/index.html",
  529. "filename": "./index.html",
  530. "hash": false,
  531. "inject": true,
  532. "compile": true,
  533. "favicon": false,
  534. "minify": false,
  535. "cache": true,
  536. "showErrors": true,
  537. "chunks": "all",
  538. "excludeChunks": [],
  539. "title": "Webpack App",
  540. "xhtml": true,
  541. "chunksSortMode": function sort(left, right) {
  542. let leftIndex = entryPoints.indexOf(left.names[0]);
  543. let rightindex = entryPoints.indexOf(right.names[0]);
  544. if (leftIndex > rightindex) {
  545. return 1;
  546. }
  547. else if (leftIndex < rightindex) {
  548. return -1;
  549. }
  550. else {
  551. return 0;
  552. }
  553. }
  554. }),
  555. new BaseHrefWebpackPlugin({}),
  556. new CommonsChunkPlugin({
  557. "minChunks": 2,
  558. "async": "common"
  559. }),
  560. new CommonsChunkPlugin({
  561. "name": [
  562. "inline"
  563. ],
  564. "minChunks": null
  565. }),
  566. new CommonsChunkPlugin({
  567. "name": [
  568. "vendor"
  569. ],
  570. "minChunks": (module) => {
  571. return module.resource
  572. && (module.resource.startsWith(nodeModules)
  573. || module.resource.startsWith(genDirNodeModules)
  574. || module.resource.startsWith(realNodeModules));
  575. },
  576. "chunks": [
  577. "main"
  578. ]
  579. }),
  580. new NamedModulesPlugin({}),
  581. new AotPlugin({
  582. "mainPath": "main.ts",
  583. "hostReplacementPaths": {
  584. "environments/environment.ts": "environments/environment.ts"
  585. },
  586. "exclude": [],
  587. "tsConfigPath": "src/main/webapp/stay-mgmt/tsconfig.app.json",
  588. "skipCodeGeneration": true
  589. })
  590. ],
  591. "node": {
  592. "fs": "empty",
  593. "global": true,
  594. "crypto": "empty",
  595. "tls": "empty",
  596. "net": "empty",
  597. "process": true,
  598. "module": false,
  599. "clearImmediate": false,
  600. "setImmediate": false
  601. },
  602. "devServer": {
  603. "historyApiFallback": true
  604. }
  605. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement