-
Notifications
You must be signed in to change notification settings - Fork 490
Production build fails with ES6 javascript files in the project #158
Comments
Is this a duplicate of #21? |
You can not compile es6 with uglify AFAIK. And we do not currently support es6 JS compilation within react-scripts-ts. |
It's duplicate only in the sense that es6 file breaks the build; in #21 such file is generated by tsc, in my case it's added by hand. I don't suppose there's easy workaround short of ejecting? Is es6 JS compilation support completely out because of reasons (dependencies, perhaps?) or to be expected some day? I'd naively imagine it would be just a matter of deleting fewer lines from react-scripts webpack config. |
I'm inclined not to add JS transpilation. I believe that it's just another place where "bugs" will be reported from. If you look through some of the closed issues where people have asked for it - they are using I'm going to close this, as I think you're after |
Is this a bug report?
Yes
Can you also reproduce the problem with npm 4.x?
Didn't try.
Which terms did you search for in User Guide?
npm run build fails to minify
Basically if you follow the step "3. If the dependency is small enough, copy it to your src/ folder and treat it as application code." in react-scripts-ts project you get this bug.
Environment
npm ls react-scripts-ts
(if you haven’t ejected): [email protected]node -v
: v8.2.1npm -v
: 5.3.0yarn --version
(if you use Yarn): 0.27.5npm ls react-scripts-ts
(if you haven’t ejected):Then, specify:
Steps to Reproduce
Add an import of ES6 javascript (
.js
) file and run build:create-react-app --scripts-version=react-scripts-ts test
cd test
echo 'export default class Test {}' > src/Test.js
src/App.tsx
:yarn run build
In the real-world example I encountered this the javascript file is a dependency that I can only copypaste into the project as it is not distributed otherwise.
Expected Behavior
Successful production build.
Actual Behavior
Development server works, but production build fails.
yarn run build
:The code on line 21758 is
class Test {
-- the code around it:The text was updated successfully, but these errors were encountered: