From ce484c670a50ad093e48d6347eb7d21457d7d706 Mon Sep 17 00:00:00 2001 From: jos Date: Sat, 7 Jan 2017 19:48:17 +0100 Subject: [PATCH] Use react for development for the great error messages, preact for bundling for production --- gulpfile.js | 5 +++-- package.json | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index a29bd07..cfb53d6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -63,6 +63,7 @@ const loaders = [ { test: /\.svg$/, loader: 'svg-url-loader' } ] +// TODO: see if preact can give the same sort of errors and warnings as react does, if so switch to preact for development too const resolve = { 'alias': { 'react': 'preact-compat', @@ -89,7 +90,7 @@ const compiler = webpack({ module: { loaders }, - resolve + resolve: WATCHING ? null : resolve }) // create a single instance of the compiler to allow caching @@ -114,7 +115,7 @@ const compilerMinimalist = webpack({ module: { loaders }, - resolve + resolve: WATCHING ? null : resolve }) const externals = { diff --git a/package.json b/package.json index b1ae3e6..a5230cc 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,9 @@ "javascript-natural-sort": "0.7.1", "lodash": "4.17.4", "preact": "7.1.0", - "preact-compat": "3.9.4" + "preact-compat": "3.9.4", + "react": "15.4.1", + "react-dom": "15.4.1" }, "devDependencies": { "ava": "0.17.0",