Skip to content

Commit e1a3177

Browse files
authored
Merge pull request #215 from gene1wood/webpack5
Update to use Webpack 5
2 parents 040a06d + 615ed5c commit e1a3177

30 files changed

+9159
-10303
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ Highlighted items from src/js/state.js for use in templates. See src/js/state.j
7979

8080
## Building
8181

82-
To publish to GitHub Pages, simply run:
82+
To publish to GitHub Pages, first generate new `docs/` files by running
8383

8484
```bash
8585
$ npm run build
8686
```
8787

88-
Then commit the newly built `docs/` files and push the commit to GitHub
88+
Then commit the newly built `docs/` files and push the commit to GitHub.
8989

9090
## Changelog
9191

config/webpack.config.js

Lines changed: 36 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -37,39 +37,28 @@ const plugins = [
3737
date: new Date().toISOString().substr(0, 10),
3838
production,
3939
revision: revision(),
40+
4041
title: 'Mozilla SSL Configuration Generator',
41-
template: 'src/templates/index.ejs'
42-
}),
43-
new CopyWebpackPlugin({
44-
patterns: [
45-
{from: 'src/images', to: 'images/'}
46-
]
47-
}),
48-
new CopyWebpackPlugin({
49-
patterns: [
50-
{from: 'config/CNAME'}
51-
]
52-
}),
53-
new CopyWebpackPlugin({
54-
patterns: [
55-
{from: 'src/static'}
56-
]
42+
template: 'src/templates/index.ejs',
43+
favicon: 'src/images/favicon.png'
5744
}),
5845
new CopyWebpackPlugin({
5946
patterns: [
47+
{from: 'config/CNAME'},
48+
{from: 'src/static'},
6049
{from: 'src/js/analytics.js'}
6150
]
6251
}),
6352
new MiniCssExtractPlugin({
64-
filename: '[hash].index.css',
53+
filename: '[contenthash].index.css',
6554
})
6655
];
6756

6857
// either we analyze or watch
6958
if (process.env.NODE_ENV === 'analyze') {
7059
plugins.push(
7160
new BundleAnalyzerPlugin({})
72-
)
61+
);
7362
} else {
7463
plugins.push(
7564
new BrowserSyncWebpackPlugin({
@@ -79,7 +68,7 @@ if (process.env.NODE_ENV === 'analyze') {
7968
baseDir: 'build'
8069
}
8170
})
82-
)
71+
);
8372
}
8473

8574
module.exports = {
@@ -88,7 +77,16 @@ module.exports = {
8877
library: 'SSLConfigGenerator',
8978
libraryTarget: 'var',
9079
path: production ? path.resolve(__dirname, '..', 'docs') : path.resolve(__dirname, '..', 'build'),
91-
filename: '[hash].[name]'
80+
filename: '[contenthash].[name]'
81+
},
82+
stats: {
83+
errorDetails: true,
84+
children: true
85+
},
86+
resolve: {
87+
fallback: {
88+
"path": require.resolve("path-browserify")
89+
}
9290
},
9391
entry: {
9492
'index.js': ['regenerator-runtime/runtime', path.resolve(__dirname, '..', 'src', 'js', 'index.js')]
@@ -99,9 +97,7 @@ module.exports = {
9997
rules: [
10098
{
10199
test: /\.ejs$/,
102-
use: {
103-
loader: 'ejs-loader',
104-
}
100+
use: ['ejs-easy-loader'],
105101
},
106102
{
107103
test: /\.hbs$/,
@@ -138,40 +134,24 @@ module.exports = {
138134
{
139135
test: /\.(sa|sc|c)ss$/,
140136
//include: path.resolve(__dirname, '..', 'src'),
141-
use: [{
142-
loader: MiniCssExtractPlugin.loader
143-
},
144-
'css-loader',
145-
{
146-
loader: 'postcss-loader', // Run post css actions
147-
options: {
148-
plugins: function () { // post css plugins, can be exported to postcss.config.js
149-
return [
150-
require('precss'),
151-
require('autoprefixer')
152-
];
137+
use: [
138+
MiniCssExtractPlugin.loader,
139+
'css-loader',
140+
{
141+
loader: 'postcss-loader', // Run post css actions
142+
options: {
143+
postcssOptions: {
144+
plugins: function () { // post css plugins, can be exported to postcss.config.js
145+
return [
146+
require('precss'),
147+
require('autoprefixer')
148+
];
149+
}
150+
}
153151
}
154-
}
155-
},
156-
'sass-loader'
157-
]},
158-
{
159-
test: /\.(ttf|eot|woff|woff2)$/,
160-
use: {
161-
loader: 'file-loader',
162-
options: {
163-
name: 'fonts/[name].[ext]'
164-
}
165-
}
166-
},
167-
{
168-
test: /\.(svg)$/,
169-
use: {
170-
loader: 'file-loader',
171-
options: {
172-
name: 'img/[name].[ext]'
173-
}
174-
}
152+
},
153+
'sass-loader'
154+
]
175155
}
176156
]
177157
},

docs/analytics.js

Lines changed: 1 addition & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/d71c765a144fca3bbc09.index.css

Lines changed: 0 additions & 109 deletions
This file was deleted.

docs/d71c765a144fca3bbc09.index.js

Lines changed: 0 additions & 63 deletions
This file was deleted.

docs/e8c09cc99d83d481bf4b.index.css

Lines changed: 107 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/f5aa7532b4392deabbf1.index.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*!
2+
* Bootstrap v4.6.2 (https://getbootstrap.com/)
3+
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5+
*/
6+
7+
/*!
8+
* clipboard.js v2.0.11
9+
* https://clipboardjs.com/
10+
*
11+
* Licensed MIT © Zeno Rocha
12+
*/
13+
14+
/*!
15+
* jQuery JavaScript Library v3.7.1
16+
* https://jquery.com/
17+
*
18+
* Copyright OpenJS Foundation and other contributors
19+
* Released under the MIT license
20+
* https://jquery.org/license
21+
*
22+
* Date: 2023-08-28T13:37Z
23+
*/
24+
25+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
26+
27+
/**!
28+
* @fileOverview Kickass library to create and place poppers near their reference elements.
29+
* @version 1.16.1
30+
* @license
31+
* Copyright (c) 2016 Federico Zivolo and contributors
32+
*
33+
* Permission is hereby granted, free of charge, to any person obtaining a copy
34+
* of this software and associated documentation files (the "Software"), to deal
35+
* in the Software without restriction, including without limitation the rights
36+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
37+
* copies of the Software, and to permit persons to whom the Software is
38+
* furnished to do so, subject to the following conditions:
39+
*
40+
* The above copyright notice and this permission notice shall be included in all
41+
* copies or substantial portions of the Software.
42+
*
43+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
46+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
48+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
49+
* SOFTWARE.
50+
*/

docs/favicon.png

885 Bytes
Loading
Binary file not shown.

0 commit comments

Comments
 (0)