b646b8a1 by Ean Schuessler

First commit for template test

0 parents
1 {
2 "presets": ["env", "react"]
3 }
1 {
2 "name": "jsx-test",
3 "version": "1.0.0",
4 "description": "",
5 "main": "index.js",
6 "scripts": {
7 "start": "webpack-dev-server --port=5000",
8 "test": "echo \"Error: no test specified\" && exit 1"
9 },
10 "author": "",
11 "license": "ISC",
12 "devDependencies": {
13 "babel-core": "^6.26.0",
14 "babel-loader": "^7.1.2",
15 "babel-preset-env": "^1.6.1",
16 "babel-preset-react": "^6.24.1",
17 "external-jsx-loader": "^1.1.0",
18 "html-webpack-plugin": "^2.30.1",
19 "react-templates": "^0.6.1",
20 "react-templates-loader": "^0.6.3",
21 "webpack": "^3.10.0",
22 "webpack-dev-server": "^2.9.7"
23 }
24 }
1 <html>
2 <head>
3 <title>Template Test</title>
4 </head>
5 <body>
6 </body>
7 </html>
1 console.log('This is main');
1 <div>
2 <h1>Its home time</h1>
3 </div>
1 const path = require("path");
2 const HtmlWebpackPlugin = require('html-webpack-plugin');
3
4 module.exports = {
5 entry: ["./src/main.js"],
6 output: {
7 path: path.resolve(__dirname, "dist"),
8 filename: "js/[name].js"
9 },
10 module: {
11 rules: [
12 {
13 test: /\.js$/,
14 exclude: /node_modules/,
15 use: {
16 loader: "babel-loader"
17 }
18 },
19 {
20 test: /\.rt$/,
21 exclude: /node_modules/,
22 use: {
23 loader: "react-templates-loader?modules=amd"
24 }
25 },
26 ]
27 },
28 plugins: [
29 new HtmlWebpackPlugin({
30 template: 'src/index.html'
31 })
32 ]
33 }