advanced.txt 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. Advanced Options:
  2. --insert-globals, --ig, --fast [default: false]
  3. Skip detection and always insert definitions for process, global,
  4. __filename, and __dirname.
  5. benefit: faster builds
  6. cost: extra bytes
  7. --insert-global-vars, --igv
  8. Comma-separated list of global variables to detect and define.
  9. Default: __filename,__dirname,process,Buffer,global
  10. --detect-globals, --dg [default: true]
  11. Detect the presence of process, global, __filename, and __dirname and define
  12. these values when present.
  13. benefit: npm modules more likely to work
  14. cost: slower builds
  15. --ignore-missing, --im [default: false]
  16. Ignore `require()` statements that don't resolve to anything.
  17. --noparse=FILE
  18. Don't parse FILE at all. This will make bundling much, much faster for giant
  19. libs like jquery or threejs.
  20. --no-builtins
  21. Turn off builtins. This is handy when you want to run a bundle in node which
  22. provides the core builtins.
  23. --no-commondir
  24. Turn off setting a commondir. This is useful if you want to preserve the
  25. original paths that a bundle was generated with.
  26. --no-bundle-external
  27. Turn off bundling of all external modules. This is useful if you only want
  28. to bundle your local files.
  29. --bare
  30. Alias for both --no-builtins, --no-commondir, and sets --insert-global-vars
  31. to just "__filename,__dirname". This is handy if you want to run bundles in
  32. node.
  33. --no-browser-field, --no-bf
  34. Turn off package.json browser field resolution. This is also handy if you
  35. need to run a bundle in node.
  36. --transform-key
  37. Instead of the default package.json#browserify#transform field to list
  38. all transforms to apply when running browserify, a custom field, like, e.g.
  39. package.json#browserify#production or package.json#browserify#staging
  40. can be used, by for example running:
  41. * `browserify index.js --transform-key=production > bundle.js`
  42. * `browserify index.js --transform-key=staging > bundle.js`
  43. --node
  44. Alias for --bare and --no-browser-field.
  45. --full-paths
  46. Turn off converting module ids into numerical indexes. This is useful for
  47. preserving the original paths that a bundle was generated with.
  48. --deps
  49. Instead of standard bundle output, print the dependency array generated by
  50. module-deps.
  51. --no-dedupe
  52. Turn off deduping.
  53. --list
  54. Print each file in the dependency graph. Useful for makefiles.
  55. --extension=EXTENSION
  56. Consider files with specified EXTENSION as modules, this option can used
  57. multiple times.
  58. --global-transform=MODULE, -g MODULE
  59. Use a transform module on all files after any ordinary transforms have run.
  60. --plugin=MODULE, -p MODULE
  61. Register MODULE as a plugin.
  62. --preserve-symlinks
  63. Preserves symlinks when resolving modules.
  64. Passing arguments to transforms and plugins:
  65. For -t, -g, and -p, you may use subarg syntax to pass options to the
  66. transforms or plugin function as the second parameter. For example:
  67. -t [ foo -x 3 --beep ]
  68. will call the `foo` transform for each applicable file by calling:
  69. foo(file, { x: 3, beep: true })