Skip to content

Instantly share code, notes, and snippets.

@th3fallen
Forked from anonymous/index.js
Last active September 19, 2017 17:44
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save th3fallen/77e7eaa36479926af876e664edafa850 to your computer and use it in GitHub Desktop.
My error
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'));
{
"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"
}
}
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',
options: {
presets: [['es2015', { 'modules': false }], 'react'],
},
}
]
}
};
module.exports = config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment