Search code examples
webpackreact-boilerplate

Q React boilerplate how to remove .bin extension from the emitted .htaccess.bin file


I'm using react boilerplate and when I run the build script "npm run build" npm executes the following command

webpack --config internals/webpack/webpack.prod.babel.js --color -p --progress --hide-modules --display-optimization-bailout

This builds the application and emits all the files to the build folder.

I have an .htaccess file in my source now when the the app is build somewhere in the build process the .htaccess file gets a .bin extension and it is emitted as .htaccess.bin

how can I prevent the build process adding the .bin extension to the .htaccess file?


Solution

  • This answer was provided in github issue of react boilerplate. This issue has been fixed in the latest build of react-boilerplate.

    Anyways, if you want to fix the issue, change the import of .htaccess in app.js to as follows

    import 'file-loader?name=.htaccess!./.htaccess';

    See the fixed app.js file in github repo of react boilerplate