Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an ES5 build #209

Closed
IcanDivideBy0 opened this issue Aug 24, 2018 · 4 comments
Closed

Provide an ES5 build #209

IcanDivideBy0 opened this issue Aug 24, 2018 · 4 comments

Comments

@IcanDivideBy0
Copy link

IcanDivideBy0 commented Aug 24, 2018

Currently using @compositor/webfont in a create-react-app fails to build the app:

yarn run v1.9.4
$ react-scripts build
Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file: 

 	./node_modules/@compositor/webfont/index.js:5 

Read more here: http://bit.ly/2tRViJ9

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

How to reproduce:

npx create-react-app my-app
cd my-app
yarn
yarn add @compositor/webfont

# import '@compositor/webfont' anywhere in the app src

yarn build
@jxnblk
Copy link
Member

jxnblk commented Aug 24, 2018

Kit components are transpiled with babel on publish (https://github.com/c8r/kit/blob/master/core/package.json#L15) – can you ensure that your babel-loader is excluding the node_modules directory?

@IcanDivideBy0
Copy link
Author

Kit components are transpiled, but webfont module isn't.

The problem comes only when using the webpack.optimize.UglifyJsPlugin (https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/config/webpack.config.prod.js#L293-L312)

@IcanDivideBy0
Copy link
Author

Maybe the @compositor/webfont is not meant to be used alone ? Yet the mdx-deck module have it as direct dependency ... https://github.com/jxnblk/mdx-deck/blob/master/package.json#L25

@IcanDivideBy0
Copy link
Author

This is problematic when using mdx-deck as a library, not with the cli ... so I'm kinda lost regarding where the issue should be tracked :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants