Skip to content

Add way to AddScript without transforming it #91

@Daniel15

Description

@Daniel15

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions