Skip to content

Commit

Permalink
Fix source maps
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Feb 21, 2019
1 parent 8efb18d commit b5f88dd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 154 deletions.
148 changes: 0 additions & 148 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
},
"dependencies": {
"@babel/runtime": "^7.3.1",
"@gulp-sourcemaps/map-sources": "^1.0.0",
"async-done": "^1.3.1",
"core-js": "^2.6.5",
"cross-fetch": "^3.0.1",
Expand All @@ -54,7 +55,6 @@
"gulp": "^4.0.0",
"gulp-babel": "^8.0.0",
"gulp-ignore": "^2.0.2",
"gulp-sourcemaps": "^2.6.5",
"gulp-yaml": "^2.0.3",
"is-ci": "^2.0.0",
"jscpd": "^2.0.6",
Expand Down
9 changes: 4 additions & 5 deletions src/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { include } = require('gulp-ignore')
const gulpBabel = require('gulp-babel')
const del = require('del')
const yamlToJson = require('gulp-yaml')
const sourcemaps = require('gulp-sourcemaps')
const mapSources = require('@gulp-sourcemaps/map-sources')

const { BUILD, BUILD_DIST } = require('../files')
const { getWatchTask } = require('../watch')
Expand All @@ -21,12 +21,11 @@ const copy = () =>
}).pipe(dest(BUILD_DIST))

const babel = () =>
src(`${BUILD}/**`, { dot: true, since: lastRun(babel) })
src(`${BUILD}/**`, { dot: true, since: lastRun(babel), sourcemaps: true })
.pipe(include(/\.(js)$/u))
.pipe(sourcemaps.init())
.pipe(gulpBabel({ comments: false, minified: true, retainLines: true }))
.pipe(sourcemaps.write('.', { sourceRoot }))
.pipe(dest(BUILD_DIST))
.pipe(mapSources(path => `${sourceRoot}/${path}`))
.pipe(dest(BUILD_DIST, { sourcemaps: '.' }))

const sourceRoot = relative(BUILD_DIST, BUILD)

Expand Down

0 comments on commit b5f88dd

Please sign in to comment.