Skip to content

Instantly share code, notes, and snippets.

Created September 19, 2017 17:40
Show Gist options
  • Save anonymous/50f9fe0c50ef57e96f5b5542cedb980a to your computer and use it in GitHub Desktop.
Save anonymous/50f9fe0c50ef57e96f5b5542cedb980a to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Sep 19, 2017.
    14 changes: 14 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    import React from "react";
    import { render } from "react-dom";

    class App extends React.Component {
    render() {
    return {
    <div>
    <h1>Hello!</h1>
    </div>
    };
    }
    }

    render(<App/>, window.document.getElementById('app'));
    27 changes: 27 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    {
    "name": "bliimo-test",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
    "start": "npm run build",
    "build": "webpack -d && copy src\\index.html dist\\index.html && webpack-dev-server --content-base src\\ --inline --hot",
    "build:prod": "webpack -p && copy src/index.html dist/index.html"
    },
    "author": "Jeff Ramirez",
    "license": "ISC",
    "dependencies": {
    "react": "^15.6.1",
    "react-dom": "^15.6.1"
    },
    "devDependencies": {
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.2",
    "babel-preset-env": "^1.6.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "babel-preset-stage-2": "^6.24.1",
    "webpack": "^3.6.0",
    "webpack-dev-server": "^2.8.2"
    }
    }
    28 changes: 28 additions & 0 deletions webpack.config.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    var webpack = require("webpack");
    var path = require("path");

    var DIST_DIR = path.resolve(__dirname, "dist");
    var SRC_DIR = path.resolve(__dirname, "src");

    var config = {
    entry: SRC_DIR + "/app/index.js",
    output: {
    path: DIST_DIR + "/app",
    filename: "bundle.js",
    publicPath: "/app"
    },
    module: {
    loaders: [
    {
    test: /\.js?/,
    include: SRC_DIR,
    loader: "babel-loader",
    query: {
    presets: ["react", "env"]
    }
    }
    ]
    }
    };

    module.exports = config;