From 2e5a5c1d07395855a920801f4864ccc0d31f7bff Mon Sep 17 00:00:00 2001 From: David Zukowski Date: Thu, 1 Dec 2016 18:28:28 -0600 Subject: [PATCH] refactor(project): move static files out of src --- README.md | 2 +- bin/compile.js | 2 +- config/project.config.js | 2 ++ config/webpack.config.js | 2 +- {src/static => public}/favicon.ico | Bin {src/static => public}/humans.txt | 0 {src/static => public}/robots.txt | 0 7 files changed, 5 insertions(+), 3 deletions(-) rename {src/static => public}/favicon.ico (100%) rename {src/static => public}/humans.txt (100%) rename {src/static => public}/robots.txt (100%) diff --git a/README.md b/README.md index 87fb41eb3..a24fe77e2 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ The application structure presented in this boilerplate is **fractal**, where fu . ├── bin # Build/Start scripts ├── config # Project and build configurations +├── public # Static public assets (not imported anywhere in source code) ├── server # Express application that provides webpack middleware │ └── main.js # Server application entry point ├── src # Application source code @@ -115,7 +116,6 @@ The application structure presented in this boilerplate is **fractal**, where fu │ │ ├── container # Connect components to actions and store │ │ ├── modules # Collections of reducers/constants/actions │ │ └── routes ** # Fractal sub-routes (** optional) -│ ├── static # Static assets (not imported anywhere in source code) │ ├── store # Redux-specific pieces │ │ ├── createStore.js # Create and instrument redux store │ │ └── reducers.js # Reducer registry and injection diff --git a/bin/compile.js b/bin/compile.js index 5ddcdcab2..fd0084949 100644 --- a/bin/compile.js +++ b/bin/compile.js @@ -42,7 +42,7 @@ const compile = () => { throw new Error('Config set to fail on warning, exiting with status code "1".') } debug('Copying static assets to dist folder.') - fs.copySync(project.paths.client('static'), project.paths.dist()) + fs.copySync(project.paths.public(), project.paths.dist()) }) .then(() => { debug('Compilation completed successfully.') diff --git a/config/project.config.js b/config/project.config.js index 3aef3a537..4692d53cd 100644 --- a/config/project.config.js +++ b/config/project.config.js @@ -17,6 +17,7 @@ const config = { path_base : path.resolve(__dirname, '..'), dir_client : 'src', dir_dist : 'dist', + dir_public : 'public', dir_server : 'server', dir_test : 'tests', @@ -112,6 +113,7 @@ function base () { config.paths = { base : base, client : base.bind(null, config.dir_client), + public : base.bind(null, config.dir_public), dist : base.bind(null, config.dir_dist) } diff --git a/config/webpack.config.js b/config/webpack.config.js index 36c7206a7..d71338701 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -58,7 +58,7 @@ webpackConfig.plugins = [ new HtmlWebpackPlugin({ template : project.paths.client('index.html'), hash : false, - favicon : project.paths.client('static/favicon.ico'), + favicon : project.paths.public('favicon.ico'), filename : 'index.html', inject : 'body', minify : { diff --git a/src/static/favicon.ico b/public/favicon.ico similarity index 100% rename from src/static/favicon.ico rename to public/favicon.ico diff --git a/src/static/humans.txt b/public/humans.txt similarity index 100% rename from src/static/humans.txt rename to public/humans.txt diff --git a/src/static/robots.txt b/public/robots.txt similarity index 100% rename from src/static/robots.txt rename to public/robots.txt