Forráskód Böngészése

added production build options

Brandon Wong 8 éve%!(EXTRA string=óta)
szülő
commit
958e65e592
8 módosított fájl, 57 hozzáadás és 23 törlés
  1. 6 1
      react/.babelrc
  2. 8 3
      react/package.json
  3. 6 1
      regular/.babelrc
  4. 8 5
      regular/package.json
  5. 6 1
      service/.babelrc
  6. 7 4
      service/package.json
  7. 7 2
      socket/.babelrc
  8. 9 6
      socket/package.json

+ 6 - 1
react/.babelrc

@@ -1,3 +1,8 @@
 {
-  "presets": ["es2015", "react"]
+  "presets": ["es2015", "react"],
+  "env": {
+    "production": {
+      "plugins": ["transform-remove-console"]
+    }
+  }
 }

+ 8 - 3
react/package.json

@@ -4,19 +4,23 @@
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1",
     "postinstall": "npm run compile",
+    "compile": "cross-env NODE_ENV=production npm run compile-both",
+    "compile-dev": "npm run compile-src && npm run compile-test; npm run compile-frontend",
+    "compile-both": "npm run compile-src; npm run compile-frontend",
     "compile-test": "babel test --out-dir test-build",
     "compile-src": "babel src --out-dir build",
     "compile-frontend": "webpack src/main.js build/bundle.js --module-bind 'js=babel-loader'",
     "compile": "npm run compile-src; npm run compile-test; npm run compile-frontend",
-    "watch": "nodemon --watch src --watch test --watch styles -e js,css,html --exec \"npm run compile --silent\""
+    "watch": "nodemon --watch src --watch test --watch styles -e js,css,html --exec \"npm run compile-dev --silent\""
   },
-  "private": true,
   "dependencies": {
     "babel-cli": "^6.6.5",
     "babel-core": "^6.7.7",
     "babel-loader": "^6.2.4",
+    "babel-plugin-transform-remove-console": "^6.8.0",
     "babel-preset-es2015": "^6.6.0",
     "babel-preset-react": "^6.5.0",
+    "cross-env": "^1.0.8",
     "react": "^15.0.1",
     "react-dom": "^15.0.1",
     "webpack": "^1.13.0"
@@ -24,5 +28,6 @@
   "devDependencies": {
     "blue-tape": "^0.2.0",
     "nodemon": "^1.9.1"
-  }
+  },
+  "private": true
 }

+ 6 - 1
regular/.babelrc

@@ -1,3 +1,8 @@
 {
-  "presets": ["es2015"]
+  "presets": ["es2015"],
+  "env": {
+    "production": {
+      "plugins": ["transform-remove-console"]
+    }
+  }
 }

+ 8 - 5
regular/package.json

@@ -4,16 +4,19 @@
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1",
     "postinstall": "npm run compile",
+    "compile": "cross-env NODE_ENV=production npm run compile-dev",
+    "compile-dev": "npm run compile-src && npm run compile-test",
     "compile-test": "babel test --out-dir test-build",
     "compile-src": "babel src --out-dir build",
-    "compile": "npm run compile-src; npm run compile-test",
-    "watch": "nodemon --watch src --watch test --exec \"npm run compile --silent\"",
-    "serverwatch": "nodemon --watch src --watch test --exec \"npm run compile --silent && node build/server.js\"",
-    "testwatch": "nodemon --watch src --watch test --exec \"npm run compile --silent && npm test\""
+    "watch": "nodemon --watch src --watch test --exec \"npm run compile-dev --silent\"",
+    "serverwatch": "nodemon --watch src --watch test --exec \"npm run compile-dev --silent && node build/server.js\"",
+    "testwatch": "nodemon --watch src --watch test --exec \"npm run compile-dev --silent && npm test\""
   },
   "dependencies": {
     "babel-cli": "^6.6.5",
-    "babel-preset-es2015": "^6.6.0"
+    "babel-plugin-transform-remove-console": "^6.8.0",
+    "babel-preset-es2015": "^6.6.0",
+    "cross-env": "^1.0.8"
   },
   "devDependencies": {
     "blue-tape": "^0.2.0",

+ 6 - 1
service/.babelrc

@@ -1,3 +1,8 @@
 {
-  "presets": ["es2015"]
+  "presets": ["es2015"],
+  "env": {
+    "production": {
+      "plugins": ["transform-remove-console"]
+    }
+  }
 }

+ 7 - 4
service/package.json

@@ -1,20 +1,23 @@
 {
   "name": "$foldername",
   "main": "build/service.js",
-  "version": "1.0.0",
+  "version": "0.1.0",
   "scripts": {
     "test": "node test-build/service.js",
     "postinstall": "npm run compile",
+    "compile": "cross-env NODE_ENV=production npm run compile-dev",
+    "compile-dev": "npm run compile-src && npm run compile-test",
     "compile-test": "babel test --out-dir test-build",
     "compile-src": "babel src --out-dir build",
-    "compile": "npm run compile-src; npm run compile-test",
-    "watch": "nodemon --watch src --watch test --exec \"npm run compile --silent\"",
+    "watch": "nodemon --watch src --watch test --exec \"npm run compile-dev --silent\"",
     "serverwatch": "nodemon --watch src --watch test --exec \"npm run compile --silent && node build/service.js\"",
-    "testwatch": "nodemon --watch src --watch test --exec \"npm run compile --silent && npm test\""
+    "testwatch": "nodemon --watch src --watch test --exec \"npm run compile-dev --silent && npm test\""
   },
   "dependencies": {
     "babel-cli": "^6.6.5",
+    "babel-plugin-transform-remove-console": "^6.8.0",
     "babel-preset-es2015": "^6.6.0",
+    "cross-env": "^1.0.8",
     "express": "^4.13.4"
   },
   "devDependencies": {

+ 7 - 2
socket/.babelrc

@@ -1,3 +1,8 @@
 {
-  "presets": ["es2015"]
-}
+  "presets": ["es2015"],
+  "env": {
+    "production": {
+      "plugins": ["transform-remove-console"]
+    }
+  }
+}

+ 9 - 6
socket/package.json

@@ -5,23 +5,26 @@
   "scripts": {
     "test": "node test-build/server.js",
     "postinstall": "npm run compile-src",
+    "compile": "cross-env NODE_ENV=production npm run compile-dev",
+    "compile-dev": "npm run compile-src && npm run compile-test",
     "compile-test": "babel test --out-dir test-build",
     "compile-src": "babel src --out-dir build",
-    "compile": "npm run compile-src; npm run compile-test",
-    "compile-start": "npm run compile && node build/server.js 2> /dev/null",
-    "watch": "nodemon --watch src --watch test --exec \"npm run --silent compile 2> /dev/null\"",
-    "testwatch": "nodemon --watch src --watch test --exec \"npm run --silent compile && npm test\"",
+    "compile-start": "npm run compile-dev && node build/server.js 2> /dev/null",
+    "watch": "nodemon --watch src --watch test --exec \"npm run --silent compile-dev 2> /dev/null\"",
+    "testwatch": "nodemon --watch src --watch test --exec \"npm run --silent compile-dev && npm test\"",
     "serverwatch": "nodemon --watch src --watch test --exec \"npm run compile-start 2> /dev/null\""
   },
   "dependencies": {
     "babel-cli": "^6.6.5",
+    "babel-plugin-transform-remove-console": "^6.8.0",
     "babel-preset-es2015": "^6.6.0",
-    "socket.io": "^1.4.5",
+    "cross-env": "^1.0.8",
+    "socket.io": "^1.4.5"
   },
   "devDependencies": {
     "blue-tape": "^0.2.0",
     "nodemon": "^1.9.1",
     "socket.io-client": "^1.4.5"
   },
-  "private": true,
+  "private": true
 }