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

rxjs-es modules cannot be compiled with webpack2 & babel6 #1917

Closed
OshotOkill opened this issue Sep 4, 2016 · 3 comments
Closed

rxjs-es modules cannot be compiled with webpack2 & babel6 #1917

OshotOkill opened this issue Sep 4, 2016 · 3 comments

Comments

@OshotOkill
Copy link

OshotOkill commented Sep 4, 2016

dependencies version:

rxjs : 5.0.0.beta-11
webpack: 2.1.0-beta.21
babel-core: 6.14.0

Code to reproduce:

.babelrc:

{
  "presets": [
    ["es2015", { "modules": false }]
  ]
}

app.js:

import { Observable } from 'rxjs-es/Observable'
import 'rxjs-es/add/observable/of'
import 'rxjs-es/add/operator/map'

const a = Observable.of(1, 2, 3, 4 ,5).map(x => x + 1)

a.subscribe(x => console.log(x))

Expected behavior:

tree-shaking codes without commonjs and compile them into es5

Actual behavior:

default

class Observable still remains. Using webpack.optimize.UglifyJsPlugin will cause an error.

default

However I tried some normal es6 codes with import/export and they had been compiled correctly.

According to #1806 I don't find any async word and scheduler to be used.

@kwonoj
Copy link
Member

kwonoj commented Sep 4, 2016

I assume this is somewhat similar to #1575, would you make sure your webpack config correctly configured to transpile modules under ./node_modules as well? AFAIK webpack + babel by default exclude to transpile under node_modules requires explicit setup.

@OshotOkill
Copy link
Author

@kwonoj How Foolish I am . I forgot to remove exclude: /node_modules/ in configuration files. Thanks for the help.

@lock
Copy link

lock bot commented Jun 7, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants