Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.04 KB | None | 0 0
  1. [18:45:39] Starting 'sass'...
  2. [18:45:40] Starting 'js'...
  3. [18:45:58] Version: webpack 1.15.0
  4. Asset Size Chunks Chunk Names
  5. main.js 1.8 kB 0 [emitted] main
  6. main.js.map 1.84 kB 0 [emitted] main
  7. [18:45:58] Finished 'sass' after 19 s
  8. [18:45:58] Finished 'js' after 19 s
  9. [18:45:58] Starting 'build'...
  10. [18:45:58] Finished 'build' after 80 μs
  11. [18:45:58] Starting 'default'...
  12. [18:45:58] Finished 'default' after 33 μs
  13.  
  14.  
  15. Start time: (2017-07-20 16:45:36 UTC) [treshold=1%]
  16. # module time %
  17. 1 ./lib/src (node_modules/vinyl-fs/lib/src/index.js) 249ms ▇▇ 1%
  18. 2 vinyl-fs (node_modules/vinyl-fs/index.js) 370ms ▇▇ 2%
  19. 3 gulp (node_modules/gulp/index.js) 405ms ▇▇ 2%
  20. 4 svgo (node_modules/svgo/lib/svgo.js) 287ms ▇▇ 1%
  21. 5 postcss-svgo (node_modules/postcss-svgo/dist/index.js) 298ms ▇▇ 1%
  22. 6 ../data/prefixes (node_modules/autoprefixer/data/prefixes.js) 324ms ▇▇ 1%
  23. 7 autoprefixer (node_modules/autoprefixer/lib/autoprefixer.js) 701ms ▇▇▇ 3%
  24. 8 cssnano (node_modules/cssnano/dist/index.js) 1.7s ▇▇▇▇▇▇▇ 7%
  25. 9 gulp-cssnano (node_modules/gulp-cssnano/index.js) 1.7s ▇▇▇▇▇▇▇ 7%
  26. 10 gulp-sourcemaps (node_modules/gulp-sourcemaps/index.js) 290ms ▇▇ 1%
  27. 11 ./Compiler (node_modules/webpack/lib/Compiler.js) 243ms ▇ 1%
  28. 12 ./WebpackOptionsApply (node_modules/webpack/lib/WebpackOptionsApply.js) 339ms ▇▇ 1%
  29. 13 ./validateSchema (node_modules/webpack/lib/validateSchema.js) 351ms ▇▇ 2%
  30. 14 webpack (node_modules/webpack/lib/webpack.js) 999ms ▇▇▇▇▇ 4%
  31. 15 ./Compiler (node_modules/webpack-stream/node_modules/webpack/lib/Compiler.js) 297ms ▇▇ 1%
  32. 16 webpack (node_modules/webpack-stream/node_modules/webpack/lib/webpack.js) 517ms ▇▇▇ 2%
  33. 17 ./path (node_modules/babel-traverse/lib/path/index.js) 528ms ▇▇▇ 2%
  34. 18 babel-traverse (node_modules/babel-traverse/lib/index.js) 585ms ▇▇▇ 3%
  35. 19 babel-template (node_modules/babel-template/lib/index.js) 771ms ▇▇▇▇ 3%
  36. 20 ./helpers (node_modules/babel-helpers/lib/helpers.js) 801ms ▇▇▇▇ 4%
  37. 21 babel-helpers (node_modules/babel-helpers/lib/index.js) 814ms ▇▇▇▇ 4%
  38. 22 ../transformation/file (node_modules/babel-core/lib/transformation/file/index.js) 1.2s ▇▇▇▇▇ 5%
  39. 23 ./lib/api/node.js (node_modules/babel-core/lib/api/node.js) 1.2s ▇▇▇▇▇ 5%
  40. 24 babel-core (node_modules/babel-core/index.js) 1.2s ▇▇▇▇▇ 5%
  41. 25 /home/u2487/trunk/node_modules/babel-lo....js (node_modules/babel-loader/lib/index.js) 1.3s ▇▇▇▇▇▇ 6%
  42. 26 /home/u2487/trunk/node_modules/babel-pr...de_modules/babel-preset-es2015/lib/index.js) 262ms ▇▇ 1%
  43. Total require(): 3750
  44. Total time: 22.8s
  45.  
  46. 'use strict'
  47. require("time-require")
  48. var gulp = require('gulp')
  49. var gutil = require('gulp-util')
  50. var nano = require('gulp-cssnano')
  51. var sass = require('gulp-sass')
  52. var sourcemaps = require('gulp-sourcemaps')
  53. var webpack = require('webpack-stream')
  54. var wpOpt = require('webpack').optimize
  55. var named = require('vinyl-named')
  56. var sassTypes = require('node-sass').types
  57. var Svgo = require('svgo')
  58.  
  59. var paths = require('./package.json').buildPaths
  60.  
  61. gulp.task('sass', function () {
  62. var _svgo = new Svgo()
  63. var svgOptimize = _svgo.optimize.bind(_svgo)
  64. var sassOpts = {
  65. functions: {
  66. 'uri-encode($val)': function uriEncode(val) {
  67. return new sassTypes.String(encodeURIComponent(val.getValue()))
  68. },
  69. 'svgo($val)': function svgo(val, done) {
  70. svgOptimize(val.getValue(), function(result) {
  71. done(new sassTypes.String(result.data))
  72. })
  73. },
  74. },
  75. }
  76.  
  77. if (process.env.NODE_ENV === 'production') {
  78.  
  79. return gulp.src(paths.sass.i)
  80. .pipe(
  81. sass(sassOpts).on('error', sass.logError)
  82. )
  83. .pipe(nano())
  84. .pipe(gulp.dest(paths.sass.o))
  85.  
  86. } else {
  87.  
  88. return gulp.src(paths.sass.i)
  89. .pipe(sourcemaps.init())
  90. .pipe(
  91. sass(sassOpts).on('error', sass.logError)
  92. )
  93. .pipe(nano())
  94. .pipe(sourcemaps.write())
  95. .pipe(gulp.dest(paths.sass.o))
  96.  
  97. }
  98. })
  99.  
  100.  
  101. gulp.task('sass:watch', function () {
  102. gulp.watch('sass/**/*.s{c,a}ss', ['sass'])
  103. })
  104.  
  105. gulp.task('js', function () {
  106. var conf = require('./webpack.config.js')
  107.  
  108. if (process.env.NODE_ENV === 'production') {
  109.  
  110. delete conf.devtool
  111. conf.plugins.push(new wpOpt.UglifyJsPlugin({
  112. compress: {
  113. warnings: false,
  114. },
  115. mangle: {
  116. except: ['$', '$super', 'exports', 'require'],
  117. },
  118. }))
  119.  
  120. }
  121.  
  122. return gulp.src(paths.js.i)
  123. .pipe(named())
  124. .pipe(webpack(conf))
  125. .pipe(gulp.dest(paths.js.o))
  126.  
  127. })
  128.  
  129. gulp.task('js:watch', function () {
  130. var conf = require('./webpack.config.js')
  131. conf.watch = true
  132.  
  133. // Webpack logs its own errors. Just swallow error to not break watch
  134. var wp = webpack(conf).on('error', function handleWebpackError() {this.emit('end')})
  135.  
  136. return gulp.src(paths.js.i)
  137. .pipe(named())
  138. .pipe(wp)
  139. .pipe(gulp.dest(paths.js.o))
  140.  
  141. })
  142.  
  143.  
  144. gulp.task('watch', ['sass'], function () {
  145. gulp.start('sass:watch')
  146. gulp.start('js:watch')
  147. })
  148.  
  149. gulp.task('build', ['sass', 'js'])
  150.  
  151. gulp.task('default', ['build'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement