Skip to content

Commit

Permalink
Update webpack and package scripts:
Browse files Browse the repository at this point in the history
  - Upgrade to latest version of podcast-index-api
  - Only build map file for development
  - Don't watch for changes when doing production build
  • Loading branch information
stevencrader committed May 17, 2021
1 parent 89251e8 commit 4774f72
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 40 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"history": "^4.10.1",
"moment": "^2.29.0",
"pluralize": "^8.0.0",
"podcast-index-api": "^1.1.6",
"podcast-index-api": "^1.1.8",
"query-string": "^6.13.5",
"react": "^16.12.0",
"react-dom": "^16.12.0",
Expand Down Expand Up @@ -69,9 +69,9 @@
"webpack-dev-server": "^3.10.3"
},
"scripts": {
"dev": "webpack-dev-server",
"dev": "webpack-dev-server --mode development --devtool inline-source-map",
"build": "webpack",
"production": "NODE_ENV='production' && webpack && node server",
"production": "NODE_ENV='production' && webpack --mode production && node server",
"start": "node server",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
Expand Down
4 changes: 2 additions & 2 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ app.use('/api/episodes/byfeedid', async (req, res) => {
// ------------------------------------------------

app.use('/api/stats', async (req, res) => {
fs.readFile('./server/data/stats.json', 'utf8', (err, data) => {
fs.readFile('./server/data/stats.json', 'utf8', (err, data) => {
// You should always specify the content type header,
// when you don't use 'res.json' for sending JSON.
res.set('Content-Type', 'application/json');
Expand All @@ -133,7 +133,7 @@ app.use('/api/newfeedstats', async (req, res) => {
})

app.use('/api/apps', async (req, res) => {
fs.readFile('./server/data/apps.json', 'utf8', (err, data) => {
fs.readFile('./server/data/apps.json', 'utf8', (err, data) => {
// You should always specify the content type header,
// when you don't use 'res.json' for sending JSON.
res.set('Content-Type', 'application/json');
Expand Down
8 changes: 3 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ const FaviconsWebpackPlugin = require('favicons-webpack-plugin')
const dotenv = require('dotenv')
dotenv.config()

const isProduction = process.env.NODE_ENV === 'production'

module.exports = {
watch: !isProduction,
mode: 'development',
devtool: 'inline-source-map',
watch: false,
mode: 'production',
devtool: false,
devServer: {
contentBase: path.join(__dirname, './server/www'),
compress: true,
Expand Down
60 changes: 30 additions & 30 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2041,10 +2041,10 @@
prop-types "^15.6.1"
react-lifecycles-compat "^3.0.4"

"@sindresorhus/is@^3.1.1":
version "3.1.2"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-3.1.2.tgz#548650de521b344e3781fbdb0ece4aa6f729afb8"
integrity sha512-JiX9vxoKMmu8Y3Zr2RVathBL1Cdu4Nt4MuNWemt1Nc06A0RAin9c5FArkhGsyMBWfCu4zj+9b+GxtjAnE4qqLQ==
"@sindresorhus/is@^4.0.0":
version "4.0.1"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.0.1.tgz#d26729db850fa327b7cacc5522252194404226f5"
integrity sha512-Qm9hBEBu18wt1PO2flE7LPb30BHMQt1eQgbV76YntdNk73XZGpn3izvGTYxbGgzXKgbCjiia0uxTd3aTNQrY/g==

"@storybook/[email protected]", "@storybook/addon-actions@^6.0.21":
version "6.0.26"
Expand Down Expand Up @@ -3001,9 +3001,9 @@
form-data "^3.0.0"

"@types/node@*":
version "14.11.10"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.11.10.tgz#8c102aba13bf5253f35146affbf8b26275069bef"
integrity sha512-yV1nWZPlMFpoXyoknm4S56y2nlTAuFYaJuQtYRAOU7xA/FJ9RY0Xm7QOkaYMMmr8ESdHIuUb6oQgR/0+2NqlyA==
version "15.3.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-15.3.0.tgz#d6fed7d6bc6854306da3dea1af9f874b00783e26"
integrity sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==

"@types/npmlog@^4.1.2":
version "4.1.2"
Expand Down Expand Up @@ -4951,9 +4951,9 @@ cache-loader@^4.1.0:
schema-utils "^2.0.0"

cacheable-lookup@^5.0.3:
version "5.0.3"
resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.3.tgz#049fdc59dffdd4fc285e8f4f82936591bd59fec3"
integrity sha512-W+JBqF9SWe18A72XFzN/V/CULFzPm7sBXzzR6ekkE+3tLG72wFZrBiBZhrZuDoYexop4PHJVdFAKb/Nj9+tm9w==
version "5.0.4"
resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005"
integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==

cacheable-request@^7.0.1:
version "7.0.1"
Expand Down Expand Up @@ -6140,9 +6140,9 @@ default-gateway@^4.2.0:
ip-regex "^2.1.0"

defer-to-connect@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.0.tgz#83d6b199db041593ac84d781b5222308ccf4c2c1"
integrity sha512-bYL2d05vOSf1JEZNx5vSAtPuBMkX8K9EUutg7zlKvTqKXHt7RhWJFbmd7qakVuf13i+IkGmp6FwSsONOf6VYIg==
version "2.0.1"
resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587"
integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==

define-properties@^1.1.2, define-properties@^1.1.3:
version "1.1.3"
Expand Down Expand Up @@ -7980,11 +7980,11 @@ good-listener@^1.2.2:
delegate "^3.1.2"

got@^11.6.0:
version "11.7.0"
resolved "https://registry.yarnpkg.com/got/-/got-11.7.0.tgz#a386360305571a74548872e674932b4ef70d3b24"
integrity sha512-7en2XwH2MEqOsrK0xaKhbWibBoZqy+f1RSUoIeF1BLcnf+pyQdDsljWMfmOh+QKJwuvDIiKx38GtPh5wFdGGjg==
version "11.8.2"
resolved "https://registry.yarnpkg.com/got/-/got-11.8.2.tgz#7abb3959ea28c31f3576f1576c1effce23f33599"
integrity sha512-D0QywKgIe30ODs+fm8wMZiAcZjypcCodPNuMz5H9Mny7RJ+IjJ10BdmGW7OM7fHXP+O7r6ZwapQ/YQmMSvB0UQ==
dependencies:
"@sindresorhus/is" "^3.1.1"
"@sindresorhus/is" "^4.0.0"
"@szmarczak/http-timer" "^4.0.5"
"@types/cacheable-request" "^6.0.1"
"@types/responselike" "^1.0.0"
Expand Down Expand Up @@ -8460,9 +8460,9 @@ http-signature@~1.2.0:
sshpk "^1.7.0"

http2-wrapper@^1.0.0-beta.5.2:
version "1.0.0-beta.5.2"
resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.0-beta.5.2.tgz#8b923deb90144aea65cf834b016a340fc98556f3"
integrity sha512-xYz9goEyBnC8XwXDTuC/MZ6t+MrKVQZOk4s7+PaDkwIsQd8IwqvM+0M6bA/2lvG8GHXcPdf+MejTUeO2LCPCeQ==
version "1.0.3"
resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d"
integrity sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==
dependencies:
quick-lru "^5.1.1"
resolve-alpn "^1.0.0"
Expand Down Expand Up @@ -11298,9 +11298,9 @@ overlayscrollbars@^1.10.2:
integrity sha512-p8oHrMeRAKxXDMPI/EBNITj/zTVHKNnAnM59Im+xnoZUlV07FyTg46wom2286jJlXGGfcPFG/ba5NUiCwWNd4w==

p-cancelable@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.0.0.tgz#4a3740f5bdaf5ed5d7c3e34882c6fb5d6b266a6e"
integrity sha512-wvPXDmbMmu2ksjkB4Z3nZWTSkJEb9lqVdMaCKpZUGJG9TMiNp9XcbG3fn9fPKjem04fJMJnXoyFPk2FmgiaiNg==
version "2.1.1"
resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf"
integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==

p-defer@^1.0.0:
version "1.0.0"
Expand Down Expand Up @@ -11802,10 +11802,10 @@ [email protected], pnp-webpack-plugin@^1.6.4:
dependencies:
ts-pnp "^1.1.6"

podcast-index-api@^1.1.6:
version "1.1.7"
resolved "https://registry.yarnpkg.com/podcast-index-api/-/podcast-index-api-1.1.7.tgz#2b2fc43889d9688e8e35edefd03a675b6b8e2073"
integrity sha512-ZADXuw6okt7G6KOrkQLg9UlpOjhpFovhSFTs5dUqNfXg4dkapPFPvkGj/Iu9YSNJv9R4vivyodsiCUkJbBO75A==
podcast-index-api@^1.1.8:
version "1.1.8"
resolved "https://registry.yarnpkg.com/podcast-index-api/-/podcast-index-api-1.1.8.tgz#24dde4424d41886b70ddd1665276401939821f0d"
integrity sha512-tZQqehwJFVIP4KJ2ST6/Qx/KeyT7WsaVn0xUwH4kJhz19RgQ1wXH8ivU8catWsBT4SIWX8a/aGkvNu9jnYux4g==
dependencies:
got "^11.6.0"

Expand Down Expand Up @@ -13696,9 +13696,9 @@ resize-img@^1.1.0:
parse-png "^1.1.1"

resolve-alpn@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.0.0.tgz#745ad60b3d6aff4b4a48e01b8c0bdc70959e0e8c"
integrity sha512-rTuiIEqFmGxne4IovivKSDzld2lWW9QCjqv80SYjPgf+gS35eaCAjaP54CCwGAwBtnCsvNLYtqxe1Nw+i6JEmA==
version "1.1.2"
resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.1.2.tgz#30b60cfbb0c0b8dc897940fe13fe255afcdd4d28"
integrity sha512-8OyfzhAtA32LVUsJSke3auIyINcwdh5l3cvYKdKO0nvsYSKuiLfTM5i78PJswFPT8y6cPW+L1v6/hE95chcpDA==

resolve-cwd@^2.0.0:
version "2.0.0"
Expand Down

0 comments on commit 4774f72

Please sign in to comment.