Git Product home page Git Product logo

Comments (10)

JamesMessinger avatar JamesMessinger commented on September 23, 2024

Yep! The only thing that globify does is expand glob patterns. All other parameters get passed straight to Browserify or Watchify. So you can specify any plugins, transforms, or options you want, including uglifyify.

globify "lib/**/*-entry-file.js" -t uglifyify --debug

from globify.

JamesMessinger avatar JamesMessinger commented on September 23, 2024

btw... you might also want to check out simplifyify, which is another one of my projects. It simplifies the Browserify CLI for most common use-cases, such as code-minification, source maps, and code-coverage instrumentation.

from globify.

franciscolourenco avatar franciscolourenco commented on September 23, 2024

I meant minifyify because some commands require the name of the files to be passed. Do you recommend one over the other?

from globify.

franciscolourenco avatar franciscolourenco commented on September 23, 2024

Ah I remember simplify now, I opened JS-DevTools/simplifyify#6 a while back.

from globify.

JamesMessinger avatar JamesMessinger commented on September 23, 2024

Yeah, minifyify is tricky, because it needs you to pass the name of a single file as an argument, which makes it not work well with glob patterns at all. I wonder if minifyify has an option to auto-generate the sourcemap file name? If so, then that would probably work for you

from globify.

franciscolourenco avatar franciscolourenco commented on September 23, 2024

When using

globify 'dist/js/*.coffee' -t uglifyify --outfile 'dist/js/*.js'

I get this error:

Error
  at new JS_Parse_Error (<anonymous>:1526:18)
  at js_error (<anonymous>:1534:11)
  at croak (<anonymous>:2026:9)
  at token_error (<anonymous>:2034:9)
  at unexpected (<anonymous>:2040:9)
  at semicolon (<anonymous>:2060:56)
  at simple_statement (<anonymous>:2240:73)
  at eval (<anonymous>:2113:19)
  at eval (<anonymous>:2073:24)
  at eval (<anonymous>:2827:23)
  at Object.parse (<anonymous>:2837:7)
  at /Users/user/Work/extension/chrome-extension/node_modules/uglifyify/node_modules/uglify-js/tools/node.js:64:33
  at Array.forEach (native)
  at Object.exports.minify (/Users/user/Work/extension/chrome-extension/node_modules/uglifyify/node_modules/uglify-js/tools/node.js:59:15)
  at Stream.ready (/Users/user/Work/extension/chrome-extension/node_modules/uglifyify/index.js:70:19)
  at Stream.<anonymous> (/Users/user/Work/extension/chrome-extension/node_modules/uglifyify/index.js:96:12)
  at _end (/Users/user/Work/extension/chrome-extension/node_modules/through/index.js:65:9)
  at Stream.stream.end (/Users/user/Work/extension/chrome-extension/node_modules/through/index.js:74:5)
  at DestroyableTransform.onend (/Users/user/Work/extension/chrome-extension/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:545:10)
  at DestroyableTransform.g (events.js:260:16)
  at emitNone (events.js:72:20)
  at DestroyableTransform.emit (events.js:166:7)
  at endReadableNT (/Users/user/Work/extension/chrome-extension/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:960:12)
  at nextTickCallbackWith2Args (node.js:474:9)
  at process._tickCallback (node.js:388:17)

from globify.

JamesMessinger avatar JamesMessinger commented on September 23, 2024

Don't forget to add the coffeescript transform

from globify.

franciscolourenco avatar franciscolourenco commented on September 23, 2024

Its in the global transforms.

from globify.

JamesMessinger avatar JamesMessinger commented on September 23, 2024

kk. well try using the raw Browserify command first, to make sure everything's correct. then replace browserify with globify. the error you're getting is from uglifyify, not globify

from globify.

franciscolourenco avatar franciscolourenco commented on September 23, 2024

Thanks, it was something with the global transforms, because I'm importing some coffee files as modules.

Now somthing else. From the Ugligyfyify docs:

"Uglifyify provides an additional optimization when used with Uglify, but does not provide all of the optimization that using Uglify on its own does, so it's not a replacement."

And indeed the bundle size resulting from uglifyify is bigger than the one produced by normal Uglifyjs2.
Is it possible to apply normal uglify with globify?

from globify.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.