b646b8a1 by Ean Schuessler

First commit for template test

0 parents
{
"presets": ["env", "react"]
}
{
"name": "jsx-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --port=5000",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"external-jsx-loader": "^1.1.0",
"html-webpack-plugin": "^2.30.1",
"react-templates": "^0.6.1",
"react-templates-loader": "^0.6.3",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.9.7"
}
}
<html>
<head>
<title>Template Test</title>
</head>
<body>
</body>
</html>
console.log('This is main');
<div>
<h1>Its home time</h1>
</div>
const path = require("path");
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: ["./src/main.js"],
output: {
path: path.resolve(__dirname, "dist"),
filename: "js/[name].js"
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /\.rt$/,
exclude: /node_modules/,
use: {
loader: "react-templates-loader?modules=amd"
}
},
]
},
plugins: [
new HtmlWebpackPlugin({
template: 'src/index.html'
})
]
}