Skip to content

Add way to AddScript without transforming it #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Daniel15 opened this issue Feb 24, 2015 · 3 comments
Closed

Add way to AddScript without transforming it #91

Daniel15 opened this issue Feb 24, 2015 · 3 comments
Milestone

Comments

@Daniel15
Copy link
Member

It's becoming more and more common to use external build systems (Gulp, Grunt) or bundlers (Webpack, Browserify) that handle the JSX transformation. The output of these can be loaded directly into ReactJS.NET as it's just vanilla JavaScript. Currently ReactJS.NET still loads JSXTransformer and runs the file through it, even though it's not necessary as the transformation has already occured externally. Add flag to AddScript to tell ReactJS.NET to not execute JSXTransformer on the code.

Pick one of these:

ReactConfiguration.Configuration
  // Option 1: `transform` flag, defaults to true
  .AddScript("~/js/server.bundle.js", transform: false)
  // Option 2: `doNotTransform` flag, defaults to false
  .AddScript("~/js/server.bundle.js", doNotTransform)
  // Option 3: Totally separate method
  .AddRawScript("~/js/server.bundle.js")
  .AddScriptWithoutTransform("~/js/server.bundle.js")

See #90

@abe238
Copy link

abe238 commented Feb 25, 2015

.AddScriptWithoutTransform("~/js/server.bundle.js")

@Daniel15
Copy link
Member Author

The only problem I had with that is it's quite long, but at least it describes what it's doing (and you'd probably only have one bundle file you're adding anyways)

@PeteDuncanson
Copy link

+1 .AddScriptWithoutTransform("~/js/server.bundle.js")

@Daniel15 Daniel15 added this to the 1.4.1 milestone Apr 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants