-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
React, Babel and Webpack into a dist folder installed and tested
- Loading branch information
Benny
committed
Aug 27, 2017
1 parent
52acc5d
commit 3906aec
Showing
7 changed files
with
2,444 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
{ | ||
"root": true, | ||
"extends": "airbnb-base", | ||
"env": { | ||
"node": true, | ||
"es6": true, | ||
"mocha": true | ||
}, | ||
"rules": { | ||
"one-var": 0, | ||
"one-var-declaration-per-line": 0, | ||
"new-cap": 0, | ||
"consistent-return": 0, | ||
"no-param-reassign": 0, | ||
"comma-dangle": 0, | ||
"curly": ["error", "multi-line"], | ||
"import/no-unresolved": [2, { "commonjs": true }], | ||
"no-shadow": ["error", { "allow": ["req", "res", "err"] }], | ||
"valid-jsdoc": ["error", { | ||
"requireReturn": true, | ||
"requireReturnType": true, | ||
"requireParamDescription": false, | ||
"requireReturnDescription": true | ||
}], | ||
"require-jsdoc": ["error", { | ||
"require": { | ||
"FunctionDeclaration": true, | ||
"MethodDefinition": true, | ||
"ClassDeclaration": true | ||
} | ||
}] | ||
} | ||
"root": true, | ||
"extends": "airbnb-base", | ||
"env": { | ||
"node": true, | ||
"es6": true, | ||
"mocha": true | ||
}, | ||
"rules": { | ||
"one-var": 0, | ||
"one-var-declaration-per-line": 0, | ||
"new-cap": 0, | ||
"consistent-return": 0, | ||
"no-param-reassign": 0, | ||
"comma-dangle": 0, | ||
"curly": ["error", "multi-line"], | ||
"import/no-unresolved": [2, { "commonjs": true }], | ||
"no-shadow": ["error", { "allow": ["req", "res", "err"] }], | ||
"valid-jsdoc": ["error", { | ||
"requireReturn": true, | ||
"requireReturnType": true, | ||
"requireParamDescription": false, | ||
"requireReturnDescription": true | ||
}], | ||
"require-jsdoc": ["error", { | ||
"require": { | ||
"FunctionDeclaration": true, | ||
"MethodDefinition": true, | ||
"ClassDeclaration": true | ||
} | ||
}] | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous"> | ||
<title>Webpack App</title> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<script src="/app/bundle.js"></script> | ||
</body> | ||
|
||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
import { render } from 'react-dom'; | ||
|
||
|
||
class App extends React.Component { | ||
render() { | ||
return ( | ||
<div className='jumbotron'> | ||
<h1 class="display-3">Hello, world!</h1> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
render(<App/>,window.document.getElementById('app')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous"> | ||
<title>Webpack App</title> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<script src="/app/bundle.js"></script> | ||
</body> | ||
|
||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
const webpack = require('webpack'); | ||
const path = require('path'); | ||
//const ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||
|
||
|
||
const DIST_DIR = path.resolve(__dirname, "./client/dist"); | ||
const SRC_DIR = path.resolve(__dirname, "./client/src"); | ||
|
||
const 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", | ||
query: { | ||
presets: ["react", "es2015", "stage-2"] | ||
} | ||
}] | ||
} | ||
}; | ||
|
||
module.exports = config; | ||
|
||
// const config = { | ||
// context: __dirname, | ||
// entry: './src/index.js', | ||
// output: { | ||
// path: __dirname, | ||
// filename: 'bundle.js' | ||
// }, | ||
// module: { | ||
// loaders: [{ | ||
// exclude: /node_modules/, | ||
// test: /\.(js|jsx)$/, | ||
// loader: 'babel' | ||
// }, | ||
// { | ||
// test: /\.scss$/, | ||
// loader: ExtractTextPlugin.extract('css!sass') | ||
// } | ||
// ] | ||
// }, | ||
// devServer: { | ||
// historyApiFallback: true, | ||
// contentBase: './' | ||
// }, | ||
// plugins: [ | ||
// new webpack.DefinePlugin({ 'process.env': { 'NODE_ENV': JSON.stringify('production') } }), | ||
// new webpack.optimize.DedupePlugin(), | ||
// new webpack.optimize.OccurenceOrderPlugin(), | ||
// new webpack.optimize.UglifyJsPlugin({ | ||
// compress: { warnings: false }, | ||
// output: { comments: false }, | ||
// mangle: false, | ||
// sourcemap: false, | ||
// minimize: true, | ||
// mangle: { except: ['$super', '$', 'exports', 'require', '$q', '$ocLazyLoad'] } | ||
// }), | ||
// new ExtractTextPlugin('src/public/stylesheets/app.css', { | ||
// allChunks: true | ||
// }) | ||
// ] | ||
// }; | ||
|
||
// module.exports = config; |