Should I publish my module’s source code on npm?

In my opinion, the best practice is to publish both minified code in dist folder and also the source code in src folder. One should also include other files such as package.json, package-lock.json, README.md, LICENSE.txt, CONTRIBUTING.md, etc which are at the root package directory. To achieve this, one should use files property in package.json to … Read more

Why would we exclude node_modules when using babel-loader?

In short, transpiling is an expensive process and many projects have thousands (if not hundreds of thousands) of lines of code imported in that babel would need to run over. Your node_modules should already be runnable without transpiling as said already and there are simple ways to exclude your node_modules but transpile any code that … Read more

Gulp + browserify + 6to5 + source maps

Use this as your start point: var gulp = require(‘gulp’); var gutil = require(‘gulp-util’); var sourcemaps = require(‘gulp-sourcemaps’); var source = require(‘vinyl-source-stream’); var buffer = require(‘vinyl-buffer’); var browserify = require(‘browserify’); var to5ify = require(‘6to5ify’); var uglify = require(‘gulp-uglify’); gulp.task(‘default’, function() { browserify(‘./src/index.js’, { debug: true }) .transform(to5ify) .bundle() .on(‘error’, gutil.log.bind(gutil, ‘Browserify Error’)) .pipe(source(‘bundle.js’)) .pipe(buffer()) .pipe(sourcemaps.init({loadMaps: … Read more

Babelify throws ParseError on import a module from node_modules

That is how Browserify transforms work, transforms only have an effect directly in the module that is being referenced. If you want a module in node_modules to have a transform, you’d need to add a package.json to that module and add babelify as a transform for that module too. e.g. “browserify”: { “transform”: [ “babelify” … Read more

How to transpile node_modules modules with babel-loader?

Question: It feels like workaround, but isn’t there a more convenient way to handle such issues? I just pretend there will be more and more untransformed packages outside in the near future (following this discussion) and do we always have to manually put the package names for it in webpacks’ exclude rule?? You can use … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)