thlorenz / browserify-shim

📩 Makes CommonJS incompatible files browserifyable.
MIT License
933 stars 87 forks source link

\ufeff character problem #199

Closed FSou1 closed 8 years ago

FSou1 commented 8 years ago

I use browserify to bundle my .js and .html files into single bundle.js. I'm really confused about next character in my template: image I've checked it in bundle.js, here is:

function(e,t,n){t.exports="\ufeffhello"},{}

This is result of sourcemaps: image

I removed sourcemap creating, uglifying but this character still here.

I tried to change html-browserify to stringify, but the problem wasn't solved.

Here is notepadd++ content of fables.list.html file, special charactes: on, encoding: utf-8-bom, length 5: image

That's my current gulp.task:

var gulp = require('gulp'),    
    browserify = require('browserify'),
    html = require('html-browserify'),
    source = require('vinyl-source-stream'),
    buffer = require('vinyl-buffer'),
    uglify = require('gulp-uglify'),
    sourcemaps = require('gulp-sourcemaps'),
    clean = require('gulp-clean');

gulp.task('browserify', function () {
    return browserify({ entries: 'client/app/js/app.module.js' })
        .transform(html)
        .bundle()
        .pipe(source('bundle.js'))
        .pipe(gulp.dest('client/dist/js'));
});
bendrucker commented 8 years ago

No idea to be honest. We need a project we can download and reproduce without extraneous dependencies (Angular, Gulp, etc) to be able to help here. Happy to reopen and check it out if you can provide that.