How to exclude specific files while compling
Is this a bug report?
No, this issue is a question.
Hi there,
I was trying to build an app with a custom library, and the file is compressed to a .min.js. But I get a lot of error while compling, any way I can exclude that file while compling?
Thanks
It doesn't sound like a CRA related issue? It'd be better if you can provide your error logs or a reproducible example :)
Hi @konekoya
Here's the log:
> yarn start
yarn run v1.9.4
$ react-scripts start
Starting the development server...
[BABEL] Note: The code generator has deoptimised the styling of D:\Github\Kikuzuki\src\library\tf.min.js as it exceeds the max of 500KB.
Failed to compile.
./src/library/tf.min.js
Line 2: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 5: 'define' is not defined no-undef
Line 6: 'define' is not defined no-undef
Line 23: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 109: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 112: Expected an assignment or function call and instead saw an expression no-unused-expressions
........
well, I didn't notice that there was a error about babel settings yesterday, and I found that to solve that problem is just eject and modify webpack settings. Is there any methods to set Babel option compact to false without eject?
Thanks.
Is there any methods to set Babel option compact to false without eject?
Hmm, not sure about this. Let's wait for maintainers :)
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
Sorry, but we don't really support directly importing minified files. Please put the original files in your project or import this script in your index.html (global scope).