Skip to content

Commit 9a56841

Browse files
Upgrade Next.js to 8.1
1 parent ee47bcd commit 9a56841

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1366
-1465
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
# Build job
3131
build:
3232
runs-on: ubuntu-latest
33+
env:
34+
NODE_OPTIONS: --openssl-legacy-provider
3335
steps:
3436
- name: Checkout
3537
uses: actions/checkout@v4

next.config.js

Lines changed: 3 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const path = require('path');
22
const glob = require('glob-all');
3-
const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');
43
const webpack = require('webpack');
54

65
module.exports = {
@@ -54,79 +53,7 @@ module.exports = {
5453

5554
webpack: (config, { dev }) => {
5655
if (!dev) {
57-
// const oldEntry = config.entry;
58-
// config.entry = () => oldEntry().then((entry) => {
59-
// entry['main.js'].push(path.resolve('./offline'));
60-
// return entry;
61-
// });
62-
63-
config.plugins.push(new SWPrecacheWebpackPlugin({
64-
cacheId: 'VergePWA',
65-
filepath: path.resolve('./static/sw.js'),
66-
staticFileGlobs: [
67-
'static/**/ *',
68-
],
69-
minify: true,
70-
staticFileGlobsIgnorePatterns: [/\.next\//],
71-
runtimeCaching: [{
72-
handler: 'fastest',
73-
urlPattern: /[.](png|jpg|css)/,
74-
}, {
75-
handler: 'networkFirst',
76-
urlPattern: /^http.*/,
77-
}],
78-
}));
79-
config.plugins = config.plugins.filter(plugin => (plugin.constructor.name !== 'UglifyJsPlugin'));
80-
config.plugins.push(new webpack.optimize.UglifyJsPlugin({
81-
uglifyOptions: {
82-
output: {
83-
comments: false,
84-
},
85-
exclude: [/\.min\.js$/gi], // skip pre-minified libs
86-
compress: {
87-
arrows: false,
88-
booleans: false,
89-
cascade: false,
90-
collapse_vars: false,
91-
comparisons: false,
92-
computed_props: false,
93-
hoist_funs: false,
94-
hoist_props: false,
95-
hoist_vars: false,
96-
if_return: false,
97-
inline: false,
98-
join_vars: false,
99-
keep_infinity: true,
100-
loops: false,
101-
negate_iife: false,
102-
properties: false,
103-
reduce_funcs: false,
104-
reduce_vars: false,
105-
sequences: false,
106-
side_effects: false,
107-
switches: false,
108-
top_retain: false,
109-
toplevel: false,
110-
typeofs: false,
111-
unused: false,
112-
warnings: false, // Suppress uglification warnings
113-
pure_getters: true,
114-
unsafe: true,
115-
unsafe_comps: true,
116-
screw_ie8: true,
117-
118-
// Switch off all types of compression except those needed to convince
119-
// react-devtools that we're using a production build
120-
conditionals: true,
121-
dead_code: true,
122-
evaluate: true,
123-
},
124-
mangle: true,
125-
},
126-
}));
127-
// config.plugins.push(new BundleAnalyzerPlugin()); <-- use to analyze the bundle size
12856
config.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/));
129-
config.plugins.push(new webpack.optimize.AggressiveMergingPlugin());
13057
}
13158
config.module.rules.push(
13259
{
@@ -163,62 +90,9 @@ module.exports = {
16390
},
16491
},
16592
);
166-
config.plugins.push(new webpack.DefinePlugin({
167-
'process.env': {
168-
NODE_ENV: JSON.stringify('production'),
169-
},
170-
}));
171-
config.plugins = config.plugins.filter(plugin => (plugin.constructor.name !== 'UglifyJsPlugin'));
172-
config.plugins.push(new webpack.optimize.UglifyJsPlugin({
173-
uglifyOptions: {
174-
output: {
175-
comments: false,
176-
},
177-
exclude: [/\.min\.js$/gi], // skip pre-minified libs
178-
compress: {
179-
arrows: false,
180-
booleans: false,
181-
cascade: false,
182-
collapse_vars: false,
183-
comparisons: false,
184-
computed_props: false,
185-
hoist_funs: false,
186-
hoist_props: false,
187-
hoist_vars: false,
188-
if_return: false,
189-
inline: false,
190-
join_vars: false,
191-
keep_infinity: true,
192-
loops: false,
193-
negate_iife: false,
194-
properties: false,
195-
reduce_funcs: false,
196-
reduce_vars: false,
197-
sequences: false,
198-
side_effects: false,
199-
switches: false,
200-
top_retain: false,
201-
toplevel: false,
202-
typeofs: false,
203-
unused: false,
204-
warnings: false, // Suppress uglification warnings
205-
pure_getters: true,
206-
unsafe: true,
207-
unsafe_comps: true,
208-
screw_ie8: true,
209-
210-
// Switch off all types of compression except those needed to convince
211-
// react-devtools that we're using a production build
212-
conditionals: true,
213-
dead_code: true,
214-
evaluate: true,
215-
},
216-
mangle: true,
217-
},
218-
}));
219-
// config.plugins.push(new BundleAnalyzerPlugin());
220-
config.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/));
221-
config.plugins.push(new webpack.optimize.AggressiveMergingPlugin());
93+
if (dev) {
94+
config.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/));
95+
}
22296

22397
return config;
22498
},

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"main": "index.js",
66
"scripts": {
77
"test": "yarn build && ./node_modules/.bin/sass-lint static/scss",
8-
"dev": "node server.js",
9-
"build": "next build && next export -o docs && echo 'vergecurrency.com' > docs/CNAME && echo '' > docs/.nojekyll && cp -r pages/paper-wallet docs && cp -r pages/seedphrase docs",
10-
"prestart": "next build",
11-
"start": "NODE_ENV=production node server.js",
8+
"dev": "NODE_OPTIONS=--openssl-legacy-provider node server.js",
9+
"build": "NODE_OPTIONS=--openssl-legacy-provider next build && NODE_OPTIONS=--openssl-legacy-provider next export -o docs && echo 'vergecurrency.com' > docs/CNAME && echo '' > docs/.nojekyll && cp -r static-pages/paper-wallet docs && cp -r static-pages/seedphrase docs",
10+
"prestart": "NODE_OPTIONS=--openssl-legacy-provider next build",
11+
"start": "NODE_ENV=production NODE_OPTIONS=--openssl-legacy-provider node server.js",
1212
"lint": "./node_modules/.bin/eslint . --fix",
1313
"updateLanguages": "node locales/updateLanguages.js",
1414
"predeploy": "yarn updateLanguages && yarn build",
@@ -39,6 +39,7 @@
3939
"compression": "^1.8.1",
4040
"css-loader": "7.1.4",
4141
"deep-filter": "^1.0.2",
42+
"emit-file-loader": "^0.0.2",
4243
"express": "^4.22.0",
4344
"gh-pages": "^6.2.0",
4445
"glob": "^11.1.0",
@@ -53,7 +54,7 @@
5354
"markdown-in-js": "^1.1.3",
5455
"moment": "^2.29.4",
5556
"moment-timezone": "0.6.0",
56-
"next": "6.1.0",
57+
"next": "8.1.0",
5758
"node-sass": "^9.0.0",
5859
"normalize.css": "^8.0.1",
5960
"npm-update-all": "^1.0.1",
@@ -78,6 +79,7 @@
7879
"webpack": "^3.10.0"
7980
},
8081
"devDependencies": {
82+
"babel-loader": "8.0.6",
8183
"eslint": "8.57.1",
8284
"eslint-config-airbnb": "^19.0.4",
8385
"eslint-config-airbnb-standard": "^3.1.0",
File renamed without changes.
File renamed without changes.

pages/paper-wallet/images/back-300dpi-alt-dogecoin.jpg renamed to static-pages/paper-wallet/images/back-300dpi-alt-dogecoin.jpg

File renamed without changes.

pages/paper-wallet/images/back-300dpi-alt-litecoin.jpg renamed to static-pages/paper-wallet/images/back-300dpi-alt-litecoin.jpg

File renamed without changes.
File renamed without changes.
File renamed without changes.

pages/paper-wallet/images/finished-sample-bagged.jpg renamed to static-pages/paper-wallet/images/finished-sample-bagged.jpg

File renamed without changes.

0 commit comments

Comments
 (0)