diff --git a/README.md b/README.md index 76898ab..b101b3e 100644 --- a/README.md +++ b/README.md @@ -211,6 +211,9 @@ Omits the reload client from the generated bundle. Adds your custom SSL certificate and key to the reload web-server. This is needed if you want to use LiveReactLoad in HTTPS site. Parameters are paths to the actual files. +#### `--no-babel` + +If you use a tool other than Babel to transform React syntax, this disables the in-browser warning that would otherwise appear. ## License diff --git a/package.json b/package.json index 4021e9d..a7f546c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "livereactload", - "version": "3.1.2", + "version": "3.2.0", "description": "Live code editing with Browserify and React", "author": "Matti Lankinen (https://github.com/milankinen)", "license": "MIT", diff --git a/src/browserify-plugin/main.js b/src/browserify-plugin/main.js index 97d8217..e2a52e8 100644 --- a/src/browserify-plugin/main.js +++ b/src/browserify-plugin/main.js @@ -15,6 +15,7 @@ function LiveReactloadPlugin(b, opts = {}) { const { port = 4474, host = null, + babel = true, client = true, dedupe = true, debug = false, @@ -33,7 +34,8 @@ function LiveReactloadPlugin(b, opts = {}) { port: Number(port), host: host, clientEnabled: client, - debug: debug + debug: debug, + babel: babel } b.on("reset", addHooks) diff --git a/src/reloading.js b/src/reloading.js index 1c19fda..55a6c51 100644 --- a/src/reloading.js +++ b/src/reloading.js @@ -349,14 +349,17 @@ function loader(mappings, entryPoints, options) { // prepare mappings before starting the app forEachValue(scope.mappings, compile); - if (isReactTransformEnabled(scope.mappings)) { - info("LiveReactLoad transform detected. Ready to rock!"); - } else { - warn( - "Could not detect LiveReactLoad transform (livereactload/babel-transform). " + - "Please see instructions how to setup the transform:\n\n" + - "https://github.com/milankinen/livereactload#installation" - ); + + if (options.babel) { + if (isReactTransformEnabled(scope.mappings)) { + info("LiveReactLoad Babel transform detected. Ready to rock!"); + } else { + warn( + "Could not detect LiveReactLoad transform (livereactload/babel-transform). " + + "Please see instructions how to setup the transform:\n\n" + + "https://github.com/milankinen/livereactload#installation" + ); + } } scope.compile = compile;