From 8ff40ef4335e190ec0b9ad3d963d0cbc0e210ddb Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sat, 23 Apr 2016 01:33:07 +0200 Subject: [PATCH] First step towards browserify --- .gitignore | 14 +------------- package.json | 18 ++++++++++++++++++ public/index.html | 7 +------ public/script.jsx | 5 +++++ 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index f26df0f..1e288b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -node_modules/ +*.min.js # Created by https://www.gitignore.io/api/webstorm,node @@ -9,18 +9,6 @@ node_modules/ # User-specific stuff: .idea -# Sensitive or high-churn files: -.idea/dataSources.ids -.idea/dataSources.xml -.idea/dataSources.local.xml -.idea/sqlDataSources.xml -.idea/dynamic.xml -.idea/uiDesigner.xml - -# Gradle: -.idea/gradle.xml -.idea/libraries - # Mongo Explorer plugin: .idea/mongoSettings.xml diff --git a/package.json b/package.json index 0feeea2..63cfe41 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,26 @@ "dotenv": "^2.0.0", "express": "~4.0.0", "express-sslify": "^1.0.1", + "jquery": "^2.2.3", "querystring": "~0.2.0", + "react": "^15.0.1", + "react-bootstrap": "^0.29.2", + "react-dom": "^15.0.1", "request": "~2.34.0", "throng": "^4.0.0" + }, + "devDependencies": { + "browserify": "^6.2.0", + "reactify": "^0.15.2", + "uglify-js": "~2.4.15", + "watchify": "^2.1.1" + }, + "scripts": { + "postinstall": "browserify public/script.jsx | uglifyjs -cm > public/bundle.min.js" + }, + "browserify": { + "transform": [ + "reactify" + ] } } diff --git a/public/index.html b/public/index.html index c1f24f8..494800e 100644 --- a/public/index.html +++ b/public/index.html @@ -12,15 +12,10 @@
- - - - - - + diff --git a/public/script.jsx b/public/script.jsx index f0cf1f0..e409c7b 100644 --- a/public/script.jsx +++ b/public/script.jsx @@ -1,5 +1,10 @@ 'use strict'; +var React = require('react'); +var ReactDOM = require('react-dom'); +var ReactBootstrap = require('react-bootstrap'); +var $ = require('jquery'); + /** * Obtains parameters from the hash of the URL * @return Object