Ver código fonte

Deploy automation started

Tankernn 8 anos atrás
pai
commit
cb506dca92
3 arquivos alterados com 25 adições e 1 exclusões
  1. 1 0
      .gitignore
  2. 2 1
      package.json
  3. 22 0
      webpack.config.production.js

+ 1 - 0
.gitignore

@@ -1,5 +1,6 @@
 # Compiled js
 bundle.js
+build/
 
 # Atom Remote-FTP
 .ftpconfig

+ 2 - 1
package.json

@@ -26,7 +26,8 @@
   },
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1",
-    "build": "browserify -t [ babelify --presets [ react ] ] -t browserify-css src/index.js -o build/app.js",
+    "package": "webpack --config webpack.config.production.js --progress --colors",
+    "deploy": "",
     "start": "webpack-dev-server --progress --colors"
   },
   "author": "Tankernn",

+ 22 - 0
webpack.config.production.js

@@ -0,0 +1,22 @@
+var path = require('path');
+var webpack = require('webpack');
+
+var BUILD_DIR = path.resolve(__dirname, 'build');
+
+module.exports = {
+  entry: './js/index.js',
+  output: { path: BUILD_DIR, filename: 'bundle.js' },
+  module: {
+    loaders: [
+      {
+        test: /.jsx?$/,
+        loader: 'babel-loader',
+        exclude: /node_modules/,
+        query: {
+          presets: ['es2015', 'react']
+        }
+      },
+      { test: /\.css$/, loader: "style-loader!css-loader?root=." },
+    ]
+  },
+};