Skip to content

Commit abe717b

Browse files
committed
updated configs and readme
1 parent 9a6c504 commit abe717b

File tree

7 files changed

+224
-27
lines changed

7 files changed

+224
-27
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 Michael Rosata
3+
Copyright (c) 2017 PacktPublishing and Michael Rosata
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+51-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,54 @@
11
## Mastering Functional Programming With JavaScript
2-
### Packt Pub
2+
##### PacktPub and Michael Rosata
33

4-
Michael Rosata © 2017
4+
The code in this repo goes along with the videos in the Packt Publishing "Mastering Functional Programming with JavaScript" course and can be followed along through the different branches of the repo. The master branch will have some of the completed project functionality so that you could use it as a base for practicing your functional programming in the future if you wanted. The other branches are specific to volumes of the course.
55

6-
The lessons in this course can be followed along through the different branches of this repo. They all build on each other. Sometimes though code from one section might not be included in the branch for the next section because it's no longer needed.
6+
To follow along with the videos, switch to the corresponding branch for that volume. IE: `git checkout volume-one` will bring you to a version of the project with all the starter files for the "volume one" videos. At the moment only `volume-one` is available.
7+
8+
9+
#### Setting Up the Project
10+
11+
You should have [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [Node](https://nodejs.org/en/download/) installed on your computer already. Additionally I recommend using [yarn](https://yarnpkg.org) for package management, but it's not required.
12+
13+
**1** - The first step is to download the project and move into the project directory.
14+
```bash
15+
# Clone the repo with either the HTTPS web address
16+
git clone https://github.com/mrosata/packt-mastering-fp.git
17+
# or if you have SSH setup for Git
18+
git clone [email protected]:mrosata/packt-mastering-fp.git
19+
20+
cd packt-mastering-jp
21+
```
22+
23+
**2** - After you have cloned the repo and changed into the project directory, move to the branch you want to work in and install the project dependencies using either `npm` or `yarn`.
24+
25+
```sh
26+
git checkout volume-one
27+
28+
# with yarn
29+
yarn install
30+
31+
# if using NPM to install
32+
npm install
33+
```
34+
35+
**3** - When the install is complete, you should be able to run the dev server on `localhost:5000`.
36+
37+
```bash
38+
# Start dev server through yarn
39+
yarn serve
40+
# Or run dev server using
41+
npm run serve
42+
```
43+
44+
45+
#### Additional Information
46+
47+
The dev server actually runs on "0.0.0.0:5000", if that is not desirable then you can configure the `HOST` and `PORT` values at the top of the [webpack.config.js](https://github.com/mrosata/packt-mastering-fp/blob/master/webpack.config.js) file.
48+
49+
The dev server should live reload in the browser anytime you make changes to a file in the "app" directory. Any changes you make to the HTML `build/index.html` file won't trigger a reload, but you shouldn't need to touch that. The main entry file for the project is `app/entry.js`, but rather than working in that file, try to think of `app/index.js` as your "main" file
50+
51+
---
52+
Michael Rosata<br>
53+
Packt Publishing<br>
54+
&copy; 2017

app/entry.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
*/
88

99
import './styles/main.scss';
10-
import app from './index';
10+
import './index';

build/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<section id="packtPubApp"></section>
1515

1616
<!-- Mastering Functional JavaScript Entry -->
17-
<script src="bundle.js" defer></script>
17+
<script src="./assets/bundle.js" defer></script>
1818

1919
</body>
2020
</html>

package.json

+12-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"license": "MIT",
88
"scripts": {
99
"build": "webpack ./app/index.js build/bundle.js --progress --colors",
10-
"serve": "webpack-dev-server --progress --colors",
10+
"serve": "webpack-dev-server --progress --colors --hot",
11+
"watch": "webpack --progress --colors --watch",
1112
"help": "webpack --help --color",
1213
"bower": "bower"
1314
},
@@ -16,25 +17,33 @@
1617
"babel-core": "^6.22.1",
1718
"babel-loader": "^6.2.10",
1819
"babel-plugin-transform-exponentiation-operator": "^6.22.0",
19-
"babel-plugin-transform-react-jsx": "^6.22.0",
20+
"babel-plugin-transform-react-jsx": "^6.23.0",
2021
"babel-preset-stage-0": "^6.22.0",
2122
"bootstrap": "^3.3.7",
2223
"bootstrap-sass": "^3.3.7",
2324
"css-loader": "^0.27.3",
2425
"exports-loader": "^0.6.4",
26+
"extract-text-webpack-plugin": "^2.1.0",
27+
"file-loader": "^0.10.1",
28+
"font-awesome-loader": "^1.0.2",
2529
"imports-loader": "^0.7.1",
2630
"node-sass": "^4.5.0",
2731
"postcss-loader": "^1.3.3",
2832
"precss": "^1.4.0",
2933
"resolve-url-loader": "^2.0.2",
3034
"sass-loader": "^6.0.3",
3135
"style-loader": "^0.14.1",
36+
"tether": "^1.4.0",
3237
"url-loader": "^0.5.8",
38+
"virtual-dom": "^2.1.1",
3339
"webpack": "^2.2.1",
34-
"webpack-dev-server": "^2.3.0"
40+
"webpack-dev-server": "^2.3.0",
41+
"webpack-hot-middleware": "^2.17.1"
3542
},
3643
"dependencies": {
3744
"bootstrap-loader": "^2.0.0",
45+
"font-awesome": "^4.7.0",
46+
"jquery": "^3.2.1",
3847
"ramda": "^0.23.0"
3948
},
4049
"repository": {

webpack.config.js

+32-8
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,29 @@ const autoprefixer = require('autoprefixer'),
44

55
const {resolve} = path;
66

7-
const BUILD_DIR = resolve(__dirname, 'build'),
8-
APP_DIR = resolve(__dirname, 'app'),
9-
HOST_NAME = '0.0.0.0', // <-- note this will be on local network
10-
PORT = 5000;
7+
const bootstrapEntryPoints = require('./webpack.bootstrap.config.js');
8+
9+
10+
const BUILD_DIR = resolve(__dirname, 'build'),
11+
APP_DIR = resolve(__dirname, 'app'),
12+
ASSETS_DIR = '/assets',
13+
OUTPUT_FILE = 'bundle.js',
14+
ENTRY_FILE = resolve(APP_DIR, 'entry.js'),
15+
HOST_NAME = 'localhost', // <-- will be on local network
16+
PORT = 5000;
1117

1218
module.exports = {
13-
entry: resolve(APP_DIR, 'entry.js'),
19+
entry: [
20+
'tether',
21+
'font-awesome-loader',
22+
bootstrapEntryPoints.dev,
23+
ENTRY_FILE
24+
],
25+
1426
output: {
15-
path: BUILD_DIR,
16-
filename: 'bundle.js'
27+
path: BUILD_DIR,
28+
filename: OUTPUT_FILE,
29+
publicPath: ASSETS_DIR
1730
},
1831
devtool: 'source-map',
1932
devServer: {
@@ -27,6 +40,7 @@ module.exports = {
2740
extensions: ['.js', '.jsx']
2841
},
2942

43+
3044
module: {
3145

3246
rules: [{
@@ -57,6 +71,16 @@ module.exports = {
5771
exclude: /(node_modules)|(bower_components)/,
5872
loader: 'babel-loader'
5973
}]
60-
}
74+
},
75+
76+
plugins: [
77+
new webpack.NoEmitOnErrorsPlugin(),
78+
new webpack.ProvidePlugin({
79+
'window.Tether': 'tether',
80+
}),
81+
new webpack.LoaderOptionsPlugin({
82+
postcss: [autoprefixer],
83+
}),
84+
]
6185

6286
};

0 commit comments

Comments
 (0)