sindresorhus / filenamify

Convert a string to a valid safe filename
MIT License
489 stars 26 forks source link

Pre-compile to es5? #3

Closed cheapsteak closed 6 years ago

cheapsteak commented 6 years ago

Getting this error when using filenamify in a create-react-app app

Failed to minify the code from this file:

    ./node_modules/filenamify/index.js:13

Read more here: [http://bit.ly/2tRViJ9](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-build-fails-to-minify)
SamVerschueren commented 6 years ago

We aim for Node.js, not the browser. You can find a more detailed explanation here https://github.com/sindresorhus/ama/issues/446.

If you use Webpack, check out babel-engine-plugin, which transpiles only the dependencies that needs to be transpiled.