Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Add support for app.browserify.options.json #7

Merged
merged 1 commit into from
Jun 21, 2015

Conversation

stubailo
Copy link
Contributor

You can now create a file to pass options to browserify, including transforms. The transforms can be loaded from NPM in the same way as other dependencies.

It's going to be used in the new React in Meteor guide, preview here: http://react-in-meteor.readthedocs.org/en/latest/client-npm/

TODO

  • write documentation for this new feature
  • squash commits

@stubailo
Copy link
Contributor Author

Sample options file to use global React when require("react") is called.

(helpful for using React Router with a global React)

{
  "transforms": {
    "exposify": {
      "global": true,
      "expose": {
        "react": "React"
      }
    }
  }
}

@stubailo stubailo force-pushed the master branch 2 times, most recently from e1219bf to 5f7b085 Compare June 18, 2015 02:19
stubailo pushed a commit to meteor/react-packages that referenced this pull request Jun 18, 2015
Also, improve sourcemaps by always passing the `debug` option to Browserify -
Meteor will strip out the source mapping comments in production anyway as part
of minification.
@stubailo
Copy link
Contributor Author

@elidoran I think this is ready now. It's actually pretty hard to write automated tests for this feature, but I ran some apps to verify that things work. If you want, I can put in some more effort to write better tests, but they will probably be in the form of a second package that uses this one (that way we can test the build plugin more directly)

elidoran added a commit that referenced this pull request Jun 21, 2015
Add support for per file options including transforms
@elidoran elidoran merged commit 4fdda60 into elidoran:master Jun 21, 2015
@elidoran
Copy link
Owner

I've committed changes on top of your PR.

  1. I added a test for options with transforms
  2. I added in the exorcist module to extract the source map and give it to CompileStep.
  3. added a note in the README about adding the options file via api.addFiles()

I tested these in my example app as well.

I haven't published it as 0.4.0 yet. Please take a look.

@stubailo
Copy link
Contributor Author

@elidoran looks awesome. Thanks for cleaning everything up and adding tests! Excited to use these new features.

@stubailo
Copy link
Contributor Author

@elidoran please let me know when you publish the new version!

@elidoran
Copy link
Owner

@stubailo published as 0.4.0

@stubailo
Copy link
Contributor Author

Stellar. Thanks for the quick turnaround.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants