Skip to content

Commit a749eba

Browse files
committed
refactor: simplify build process to only utilize webpack
This is still very much a work in progress but essentially my plan is to use the `webpack`, along with the following plugins, to generate the site... - DirectoryTreePlugin: Creates a JSON representation of `src/content` for navigation and `import()` - StaticSiteGeneratorPlugin: Creates HTML files in `/dist` for all markdown pages - RedirectPlugin: Generates redirects in a similar manner to antwar (?) - And then any of the standard plugins... This rewrite also means the site would be both an SPA as well as a static site and should make finishing the PWA ticket much easier. More to come...
1 parent 8ccb3da commit a749eba

15 files changed

+206
-8497
lines changed

.babelrc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"presets": [
3-
"env",
3+
["env", { "modules": false }],
44
"react"
55
],
66
"plugins": [
7+
"react-hot-loader/babel",
8+
"syntax-dynamic-import",
79
"transform-object-rest-spread",
810
"transform-class-properties"
911
]

.editorconfig

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ root = true
66
trim_trailing_whitespace = true
77
insert_final_newline = true
88

9-
# Format All Source Files
10-
[*.{md,js,jsx,json,scss,hbs,*rc}]
9+
# Format Source Code
10+
[*.{md,js,jsx,json,scss,hbs}]
1111
charset = utf-8
1212
indent_style = space
1313
indent_size = 2
1414

15-
# Format Any Missing Config Files
16-
[.eslintignore]
15+
# Format Configs
16+
[.eslintignore,*rc]
1717
indent_style = space
1818
indent_size = 2

.eslintignore

-2
This file was deleted.

.eslintrc

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
11
{
22
"root": true,
3-
43
"extends": "eslint:recommended",
5-
64
"parser": "babel-eslint",
7-
85
"env": {
96
"browser": true,
107
"es6": true,
118
"node": true
129
},
13-
1410
"plugins": [
1511
"markdown"
1612
],
17-
1813
"globals": {
1914
"__DEV__": true
2015
},
21-
2216
"rules": {
2317
"no-undef": 2,
2418
"no-unreachable": 2,
2519
"no-unused-vars": 0,
2620
"no-console": 0,
27-
"semi": ["error", "always"]
21+
"semi": [ "error", "always" ]
2822
}
2923
}

.gitignore

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
node_modules
22
npm-debug.log
3-
build
4-
generated
5-
support-*.json
6-
starter-kits-data.json
7-
.antwar
3+
dist
4+
_*

antwar.bootstrap.js

-16
This file was deleted.

antwar.config.js

-133
This file was deleted.

package.json

+11-8
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,18 @@
2424
"node": ">=6.9"
2525
},
2626
"scripts": {
27-
"start": "npm run init:generated && npm run fetch && node ./antwar.bootstrap.js develop",
28-
"start-only": "node ./antwar.bootstrap.js develop",
29-
"build": "npm run init:generated && npm run fetch && rm -rf build/ && node ./antwar.bootstrap.js build && npm run sitemap && echo webpack.js.org > build/CNAME",
30-
"build-test": "npm run build && http-server build/",
31-
"deploy": "gh-pages -d build",
27+
"start": "webpack-dev-server --config webpack.dev.js --env.dev",
28+
"build": "webpack --config webpack.prod.js",
3229
"fetch": "sh src/scripts/fetch.sh",
33-
"init:generated": "mkdirp ./generated/loaders && mkdirp ./generated/plugins ",
30+
"test": "npm run lint",
3431
"lint": "run-s lint:*",
3532
"lint:js": "eslint . --ext .js --ext .jsx",
3633
"lint:markdown": "markdownlint --config ./.markdownlint.json *.md ./src/content/**/*.md",
3734
"lint:social": "alex . -q",
3835
"lint:prose": "cp .proselintrc ~/ && proselint src/content",
39-
"test": "npm run lint",
40-
"sitemap": "cd build && sitemap-static --prefix=https://webpack.js.org/ > sitemap.xml"
36+
"todo": "... && npm run sitemap && echo webpack.js.org > build/CNAME",
37+
"sitemap": "cd dist && sitemap-static --prefix=https://webpack.js.org/ > sitemap.xml",
38+
"deploy": "gh-pages -d build"
4139
},
4240
"devDependencies": {
4341
"alex": "^4.1.0",
@@ -49,12 +47,14 @@
4947
"babel-core": "^6.26.0",
5048
"babel-eslint": "^7.2.3",
5149
"babel-loader": "^7.1.2",
50+
"babel-plugin-syntax-dynamic-import": "^6.18.0",
5251
"babel-plugin-transform-class-properties": "^6.24.1",
5352
"babel-plugin-transform-object-rest-spread": "^6.26.0",
5453
"babel-preset-env": "^1.6.0",
5554
"babel-preset-react": "^6.24.1",
5655
"copy-webpack-plugin": "^4.3.0",
5756
"css-loader": "^0.28.5",
57+
"directory-tree-webpack-plugin": "^0.2.0",
5858
"duplexer": "^0.1.1",
5959
"eslint": "4.5.0",
6060
"eslint-loader": "^1.9.0",
@@ -66,6 +66,7 @@
6666
"gh-pages": "^1.0.0",
6767
"github": "^10.0.0",
6868
"html-webpack-plugin": "^2.30.1",
69+
"html-webpack-template": "^6.1.0",
6970
"http-server": "^0.10.0",
7071
"hyperlink": "^3.0.1",
7172
"loader-utils": "^1.1.0",
@@ -84,6 +85,7 @@
8485
"prism-languages": "^0.3.3",
8586
"prismjs": "^1.9.0",
8687
"raw-loader": "^0.5.1",
88+
"remark-loader": "^0.3.0",
8789
"request": "^2.81.0",
8890
"sass-loader": "^6.0.6",
8991
"sitemap-static": "^0.4.2",
@@ -104,6 +106,7 @@
104106
"prop-types": "^15.5.10",
105107
"react": "^15.6.1",
106108
"react-dom": "^15.6.1",
109+
"react-hot-loader": "^4.0.0-beta.12",
107110
"react-router": "^4.2.0",
108111
"react-router-dom": "^4.2.2",
109112
"tool-list": "^0.11.0",

redirects.json

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"/support": "/contribute",
3+
"/writers-guide": "/contribute/writers-guide",
4+
"/api/passing-a-config": "configuration-types",
5+
"/guides/code-splitting-import": "/guides/code-splitting",
6+
"/guides/code-splitting-require": "/guides/code-splitting",
7+
"/guides/code-splitting-async": "/guides/code-splitting",
8+
"/guides/code-splitting-css": "/guides/code-splitting",
9+
"/guides/code-splitting-libraries": "/guides/code-splitting",
10+
"/guides/why-webpack": "/comparison",
11+
"/guides/production-build": "/guides/production",
12+
"/get-started": "/guides/getting-started",
13+
"/get-started/install-webpack": "/guides/installation",
14+
"/get-started/why-webpack": "/guides/why-webpack",
15+
"/pluginsapi": "/api/plugins",
16+
"/pluginsapi/compiler": "/api/compiler",
17+
"/pluginsapi/template": "/api/template",
18+
"/api/plugins/compiler": "/api/compiler",
19+
"/api/plugins/compilation": "/api/compilation",
20+
"/api/plugins/module-factories": "/api/module-factories",
21+
"/api/plugins/parser": "/api/parser",
22+
"/api/plugins/tapable": "/api/tapable",
23+
"/api/plugins/template": "/api/template",
24+
"/api/plugins/resolver": "/api/resolver",
25+
"/development": "/contribute",
26+
"/development/plugin-patterns": "/contribute/plugin-patterns",
27+
"/development/release-process": "/contribute/release-process",
28+
"/development/how-to-write-a-loader": "/contribute/writing-a-loader",
29+
"/development/how-to-write-a-plugin": "/contribute/writing-a-plugin"
30+
}

src/favicon.ico

31.3 KB
Binary file not shown.

src/utilities/combine-contexts.js

-19
This file was deleted.

0 commit comments

Comments
 (0)