From dbd4bd332ef7f00ebe8e190b3f66932857df663d Mon Sep 17 00:00:00 2001 From: Jeremy Bernier Date: Tue, 29 Oct 2019 10:49:59 +0900 Subject: [PATCH 1/2] update --- README.md | 2 ++ webpack/development/dev.config.js | 9 +++++++-- webpack/production/prod.config.js | 13 +++++++++---- webpack/symlinks.js | 17 ----------------- 4 files changed, 18 insertions(+), 23 deletions(-) delete mode 100644 webpack/symlinks.js diff --git a/README.md b/README.md index 0d1af0a..fdc8162 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ This is a React/Redux single page app that can be used as boilerplate for any starting project, or simply for educational purposes. +**NOTE: This boilerplate is years old (which in the frontend world is like decades old), and at this point is outdated. Webpack, Babel, React-Router, etc. all need to be upgraded (unfortunately not as trivial as changing versions). Thus I do not recommend using this boilerplate beyond simply being a reference. + ### Features: * Universal/Isomorphic rendering diff --git a/webpack/development/dev.config.js b/webpack/development/dev.config.js index 1b92cec..e075f5b 100644 --- a/webpack/development/dev.config.js +++ b/webpack/development/dev.config.js @@ -3,8 +3,6 @@ var webpack = require('webpack') const ROOT = '../..' const PORT = require(ROOT + '/config/serverConfig.json').PORT -require('../symlinks')() - var configVars = { NODE_ENV: JSON.stringify('development'), BROWSER: JSON.stringify(true) @@ -24,6 +22,13 @@ module.exports = { filename: 'js/main.bundle.js', publicPath: `http://localhost:${PORT}/` }, + resolve: { + alias: { + Src: path.join(__dirname, ROOT + '/src'), + Config: path.join(__dirname, ROOT + '/config'), + }, + extensions: ['.js', '.jsx'] + }, plugins: [ new webpack.LoaderOptionsPlugin({ debug: true, diff --git a/webpack/production/prod.config.js b/webpack/production/prod.config.js index 43aeda6..9392ebf 100644 --- a/webpack/production/prod.config.js +++ b/webpack/production/prod.config.js @@ -6,9 +6,7 @@ var WebpackMd5Hash = require('webpack-md5-hash') //required for ChunkManifestPlu var ManifestPlugin = require('webpack-manifest-plugin') const ROOT = '../..' -require('../symlinks')() - -const VERSION = require(ROOT + '/package.json').version || '0.0.0' +// const VERSION = require(ROOT + '/package.json').version || '0.0.0' var configVars = { NODE_ENV: JSON.stringify('production'), @@ -16,7 +14,7 @@ var configVars = { } const config = require(ROOT + '/config/config.js')['production'] -const { STATIC_URL } = config +// const { STATIC_URL } = config module.exports = { context: path.resolve(__dirname, ROOT), @@ -41,6 +39,13 @@ module.exports = { filename: 'js/[name]_[chunkhash]_bundle.js', chunkFilename: 'js/[name]_[chunkhash]_chunk.js' }, + resolve: { + alias: { + Src: path.join(__dirname, ROOT + '/src'), + Config: path.join(__dirname, ROOT + '/config'), + }, + extensions: ['.js', '.jsx'] + }, plugins: [ new webpack.LoaderOptionsPlugin({ minimize: true, diff --git a/webpack/symlinks.js b/webpack/symlinks.js deleted file mode 100644 index a627365..0000000 --- a/webpack/symlinks.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Symlinks: - * - * @app -> if dev then src folder, if prod then bin folder - * @static -> static - * - * Note: Symlink also in package.json because @app needs to point to bin after compilation - * when running production - */ - -const execSync = require('child_process').execSync - -module.exports = function () { - execSync("rm -rf node_modules/@app && ln -sf ../src node_modules/@app") - execSync("[ -h ./node_modules/@static ] || ln -sf ../static ./node_modules/@static") - execSync("[ -h ./node_modules/@config ] || ln -sf ../config ./node_modules/@config") -} \ No newline at end of file From da79a739941b49d34f8e863a682931216ea0ad77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2019 01:51:18 +0000 Subject: [PATCH 2/2] Bump is-my-json-valid from 2.16.0 to 2.20.0 Bumps [is-my-json-valid](https://github.com/mafintosh/is-my-json-valid) from 2.16.0 to 2.20.0. - [Release notes](https://github.com/mafintosh/is-my-json-valid/releases) - [Commits](https://github.com/mafintosh/is-my-json-valid/compare/v2.16.0...v2.20.0) Signed-off-by: dependabot[bot] --- yarn.lock | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9ae4a6f..81e25d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2176,8 +2176,10 @@ gaze@^1.0.0: globule "^1.0.0" generate-function@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" + version "2.3.1" + resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.3.1.tgz#f069617690c10c868e73b8465746764f97c3479f" + dependencies: + is-property "^1.0.2" generate-object-property@^1.1.0: version "1.2.0" @@ -2590,12 +2592,17 @@ is-glob@^2.0.0, is-glob@^2.0.1: dependencies: is-extglob "^1.0.0" +is-my-ip-valid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz#7b351b8e8edd4d3995d4d066680e664d94696824" + is-my-json-valid@^2.10.0: - version "2.16.0" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" + version "2.20.0" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.20.0.tgz#1345a6fca3e8daefc10d0fa77067f54cedafd59a" dependencies: generate-function "^2.0.0" generate-object-property "^1.1.0" + is-my-ip-valid "^1.0.0" jsonpointer "^4.0.0" xtend "^4.0.0" @@ -2643,7 +2650,7 @@ is-primitive@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" -is-property@^1.0.0: +is-property@^1.0.0, is-property@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" @@ -5595,8 +5602,8 @@ xdg-basedir@^2.0.0: os-homedir "^1.0.0" xtend@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" y18n@^3.2.1: version "3.2.1"