2

I installed the following packages:

npm install --save-dev babelify@next @babel/core @babel/preset-env babel-preset-minify

I can successfully browserify my NodeJS Express app with:

./node_modules/browserify/bin/cmd.js src/app.js -o src/bundle.js --node --exclude aws-sdk --transform [ babelify --presets [ "@babel/preset-env" ] ]

But if I try to add minify:

./node_modules/browserify/bin/cmd.js src/app.js -o src/bundle.js --node --exclude aws-sdk --transform [ babelify --presets [ "@babel/preset-env" , babel-preset-minify ] ]

I get:

Error: Cannot find module 'babel-preset-,' from '{projectDir}/' while parsing file: {projectDir}/src/bundle.js
...

The same happens if I change "babel-preset-minify" to just "minify".

What's missing here so I can minify my bundle.js?

villasv
  • 6,304
  • 2
  • 44
  • 78
  • I see missing quotation marks around babel-preset-minify. And I guess that you are mising uglify plugin.. – bigless Jul 21 '18 at 20:49
  • 1
    The missing quotations are optional AFIK, and why would I be missing the uglify plugin? – villasv Jul 22 '18 at 14:56

0 Answers0