First commit for template test
0 parents
Showing
6 changed files
with
71 additions
and
0 deletions
package.json
0 → 100644
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 | } |
src/index.html
0 → 100644
src/main.js
0 → 100644
1 | console.log('This is main'); |
src/views/home.rt
0 → 100644
webpack.config.js
0 → 100644
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 | } |
-
Please register or sign in to post a comment