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

tree shaking do not support Code Splitting vendor? #2253

Closed
rambo-panda opened this issue Nov 5, 2018 · 1 comment
Closed

tree shaking do not support Code Splitting vendor? #2253

rambo-panda opened this issue Nov 5, 2018 · 1 comment

Comments

@rambo-panda
Copy link

❔ Question

tree shaking looks like it doesn't support vendor ?

πŸ’» Code Sample

vendor.js // this is my common vendor.js

import ('vue');

app.js

import './deps/vendor.js';

import Vue from 'vue';
// do something by Vue

index.html

...
<script src="./app.js"></script>
...
  • npx parcel build --experimental-scope-hoisting index.html
 // built code
    a([["vue.runtime.esm.d7f83dcc.js", "QPfz"], "QPfz"]);
    require("QPfz"),
    console.log(require("QPfz").default);

// chrome dev tools throw error
Uncaught Error: Cannot find module 'QPfz'

but it's normal if l remove import './deps/vendor.js';;

I know that I should use it like this.

import ('vue').then(() => {
    // do something
});

but it's normal when parcel build no --experimental-scope-hoisting

🌍 Your Environment

Software Version(s)
Parcel 1.10.3
Node 10.
npm/Yarn 6.4.1
Operating System mac
@rambo-panda
Copy link
Author

the issues repeats with 2300

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

No branches or pull requests

3 participants
@devongovett @rambo-panda and others