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/package.json b/package.json index b6247af..61fcd06 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "express": "4.14.0", "history": "3.2.1", "isomorphic-fetch": "2.2.1", - "lodash": "4.15.0", + "lodash": "4.17.13", "lost": "7.1.0", "mobile-detect": "^1.3.5", "node-sass": "4.5.0", 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 diff --git a/yarn.lock b/yarn.lock index 9ae4a6f..73f3983 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3013,9 +3013,9 @@ lodash@4.13.1: version "4.13.1" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.13.1.tgz#83e4b10913f48496d4d16fec4a560af2ee744b68" -lodash@4.15.0, "lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.5.0, lodash@^4.6.1: - version "4.15.0" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.15.0.tgz#3162391d8f0140aa22cf8f6b3c34d6b7f63d3aa9" +lodash@4.17.13, "lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.5.0, lodash@^4.6.1: + version "4.17.13" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.13.tgz#0bdc3a6adc873d2f4e0c4bac285df91b64fc7b93" lodash@^3.10.1: version "3.10.1"