Skip to content

Instantly share code, notes, and snippets.

@th3fallen th3fallen/index.js forked from anonymous/index.js
Last active Sep 19, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.