Skip to content
This repository has been archived by the owner on Feb 18, 2020. It is now read-only.

Source map is not generated. #1

Open
yanickrochon opened this issue Nov 22, 2017 · 0 comments
Open

Source map is not generated. #1

yanickrochon opened this issue Nov 22, 2017 · 0 comments

Comments

@yanickrochon
Copy link

Given this code

'use strict';

const browserify = require('browserify');
const gulp = require('gulp');
const source = require('vinyl-source-stream');
const derequire = require('gulp-derequire');
const buffer = require('vinyl-buffer');
const butternut = require('gulp-butternut');
const gutil = require('gulp-util');
const path = require('path');
const pkg = require('./package');
const upperCamelCase = require('uppercamelcase');

const SRC_PATH = path.dirname(pkg.main);
const DIST_PATH = path.dirname(pkg.browser);

const INPUT_FILE = path.basename(pkg.main);
const OUTPUT_FILE = path.basename(pkg.browser);
const SOURCE_MAP = OUTPUT_FILE + '.map';

const MODULE_NAME = upperCamelCase(pkg.name);


gulp.task('default', () => {
  // set up the browserify instance on a task basis
  const browserified = browserify({
    entries: INPUT_FILE,
    basedir: SRC_PATH,
    transform: ['babelify'],
    standalone: MODULE_NAME,
    debug: true
  });

  return browserified.bundle()
    .pipe(source(OUTPUT_FILE))
    .pipe(buffer())
    .pipe(derequire())
    .pipe(butternut({ sourceMap: true, source: SOURCE_MAP }))
    .on('error', gutil.log)
    .pipe(gulp.dest(DIST_PATH))
  ;
});

The minified version is created, but not the source map. Any idea why?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant