Skip to content

Commit d371957

Browse files
committed
chore - Port to webpack 2
1 parent 6bcf693 commit d371957

File tree

5 files changed

+1495
-1075
lines changed

5 files changed

+1495
-1075
lines changed

antwar.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var markdown = require('./utilities/markdown');
55
var highlight = require('./utilities/highlight');
66

77
module.exports = {
8+
maximumWorkers: process.env.TRAVIS && 1, // Faster on Travis
89
template: {
910
title: 'webpack',
1011
description: 'webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.',
@@ -245,10 +246,10 @@ function processPage() {
245246
return o.sectionName + '/' + o.fileName.split('.')[0]
246247
},
247248
content: function(o) {
248-
return markdown().process(o.file.__content, highlight);
249+
return markdown().process(o.file.body, highlight);
249250
},
250251
anchors: function(o) {
251-
return markdown().getAnchors(o.file.__content);
252+
return markdown().getAnchors(o.file.body);
252253
},
253254
contributors: function(o) {
254255
return Array.isArray(o.file.contributors) && o.file.contributors.length && o.file.contributors.slice().sort();

package.json

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -41,70 +41,69 @@
4141
"sitemap": "cd build && sitemap-static --prefix=https://webpack.js.org/ > sitemap.xml"
4242
},
4343
"devDependencies": {
44-
"alex": "^3.1.0",
45-
"antwar": "0.8.1-alpha.078b5fbf",
46-
"antwar-helpers": "0.8.1-alpha.078b5fbf",
47-
"antwar-interactive": "0.8.1-alpha.078b5fbf",
48-
"antwar-prevnext-plugin": "0.8.1-alpha.078b5fbf",
49-
"async": "^2.1.2",
50-
"autoprefixer": "^6.3.7",
51-
"babel-core": "^6.10.4",
52-
"babel-eslint": "^6.1.2",
53-
"babel-loader": "^6.2.5",
54-
"babel-plugin-transform-object-rest-spread": "^6.16.0",
55-
"babel-preset-env": "^0.0.8",
56-
"babel-preset-react": "^6.11.1",
44+
"alex": "^4.0.1",
45+
"antwar": "^0.12.0",
46+
"antwar-helpers": "^0.10.0",
47+
"antwar-interactive": "^0.10.0",
48+
"antwar-prevnext-plugin": "^0.10.0",
49+
"async": "^2.2.0",
50+
"autoprefixer": "^6.7.7",
51+
"babel-core": "^6.24.0",
52+
"babel-eslint": "^7.2.1",
53+
"babel-loader": "^6.4.1",
54+
"babel-plugin-transform-object-rest-spread": "^6.23.0",
55+
"babel-preset-env": "^1.3.2",
56+
"babel-preset-react": "^6.23.0",
5757
"copy-webpack-plugin": "^4.0.1",
58-
"css-loader": "^0.25.0",
58+
"css-loader": "^0.28.0",
5959
"duplexer": "^0.1.1",
60-
"eslint": "3.6.0",
61-
"eslint-loader": "^1.5.0",
62-
"eslint-plugin-markdown": "^1.0.0-beta.2",
63-
"extract-text-webpack-plugin": "^1.0.1",
64-
"file-loader": "^0.9.0",
60+
"eslint": "3.19.0",
61+
"eslint-loader": "^1.7.1",
62+
"eslint-plugin-markdown": "^1.0.0-beta.4",
63+
"extract-text-webpack-plugin": "^2.1.0",
64+
"file-loader": "^0.11.0",
6565
"fontgen-loader": "^0.2.1",
6666
"gh-pages": "^0.12.0",
6767
"github": "^5.2.3",
68-
"html-webpack-plugin": "^2.22.0",
68+
"html-webpack-plugin": "^2.28.0",
6969
"http-server": "^0.9.0",
70-
"hyperlink": "^2.7.0",
71-
"json-loader": "^0.5.4",
72-
"lodash": "^4.16.1",
73-
"markdown-loader": "^0.1.7",
74-
"markdownlint": "^0.2.0",
70+
"hyperlink": "^2.7.1",
71+
"lodash": "^4.17.4",
72+
"markdown-loader": "^2.0.0",
73+
"markdownlint": "^0.4.1",
7574
"markdownlint-cli": "^0.2.0",
7675
"marked": "^0.3.6",
7776
"mkdirp": "^0.5.1",
7877
"modularscale-sass": "^2.1.1",
79-
"moment": "^2.15.1",
78+
"moment": "^2.18.1",
8079
"ncp": "^2.0.0",
81-
"node-sass": "^3.9.3",
82-
"npm-run-all": "^3.1.0",
83-
"postcss-loader": "^0.13.0",
84-
"prism-languages": "^0.3.1",
85-
"prismjs": "^1.5.1",
80+
"node-sass": "^4.5.2",
81+
"npm-run-all": "^4.0.2",
82+
"postcss-loader": "^1.3.3",
83+
"prism-languages": "^0.3.3",
84+
"prismjs": "^1.6.0",
8685
"raw-loader": "^0.5.1",
87-
"request": "^2.75.0",
88-
"sass-loader": "^4.0.2",
89-
"sitemap-static": "^0.3.1",
90-
"style-loader": "^0.13.1",
91-
"tap-min": "^1.1.0",
86+
"request": "^2.81.0",
87+
"sass-loader": "^6.0.3",
88+
"sitemap-static": "^0.4.0",
89+
"style-loader": "^0.16.1",
90+
"tap-min": "^1.2.1",
9291
"tap-parser": "^5.3.3",
9392
"through2": "^2.0.3",
94-
"url-loader": "^0.5.7",
95-
"webpack": "^1.13.2",
96-
"webpack-dev-server": "^1.16.1",
97-
"webpack-merge": "^0.14.1",
98-
"yaml-frontmatter-loader": "0.0.3"
93+
"url-loader": "^0.5.8",
94+
"webpack": "^2.3.2",
95+
"webpack-dev-server": "^2.4.2",
96+
"webpack-merge": "^4.1.0",
97+
"yaml-frontmatter-loader": "^0.1.0"
9998
},
10099
"dependencies": {
101-
"d3": "^4.2.7",
102-
"filesize": "^3.3.0",
103-
"preact": "^6.2.1",
104-
"preact-compat": "3.11.0",
105-
"react": "^15.3.2",
106-
"react-dom": "^15.3.2",
100+
"d3": "^4.7.4",
101+
"filesize": "^3.5.6",
102+
"preact": "^7.2.1",
103+
"preact-compat": "3.14.3",
104+
"react": "^15.4.2",
105+
"react-dom": "^15.4.2",
107106
"react-router": "^2.8.1",
108-
"whatwg-fetch": "^2.0.1"
107+
"whatwg-fetch": "^2.0.3"
109108
}
110109
}

template.ejs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
<html>
33
<head>
44
<meta charset="UTF-8">
5-
<title><%= webpackConfig.template.title %></title>
6-
<meta name="description" content="<%= webpackConfig.template.description %>">
5+
<title><%= htmlWebpackPlugin.options.context.title %></title>
6+
<meta name="description" content="<%= htmlWebpackPlugin.options.context.description %>">
77
<meta name="viewport" content="width=device-width, initial-scale=1">
88
<meta name="theme-color" content="#2B3A42">
99
<link rel="shortcut icon" href="/assets/favicon.ico">
1010

1111
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:400,600|Source+Sans+Pro:200,400,400i,500" rel="stylesheet">
1212

1313
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css" />
14-
<% for (var file in webpackConfig.template.cssFiles) { %>
15-
<link href="<%= webpackConfig.template.cssFiles[file] %>" rel="stylesheet">
14+
<% for (var file of htmlWebpackPlugin.options.context.cssFiles) { %>
15+
<link href="<%= file %>" rel="stylesheet">
1616
<% } %>
1717

1818
<script src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
1919
</head>
2020
<body>
2121
<%- webpackConfig.html %>
2222

23-
<% for (var script of webpackConfig.template.jsFiles) { %>
23+
<% for (var script of htmlWebpackPlugin.options.context.jsFiles) { %>
2424
<script src="<%= script %>"></script>
2525
<% } %>
2626

0 commit comments

Comments
 (0)