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

Unused export removed from build library target #1436

Closed
lossendae opened this issue Jun 2, 2018 · 2 comments
Closed

Unused export removed from build library target #1436

lossendae opened this issue Jun 2, 2018 · 2 comments

Comments

@lossendae
Copy link

Version

3.0.0-beta.15

Reproduction link

https://github.com/lossendae/vue-table

Steps to reproduce

I want to expose 2 components and 2 mixins from my library (and eventually later, when its working, move the install function as well, in order to set the default import to VueTable)

When i build the library with vue-cli-service build --target lib --name VueTable src/main.js the install function is available but none of the 4th exports

What is expected?

I would like to be able to import the modules with import { VueTable, vueTableMixin, VueTablePagination, vueTablePaginationMixin } from '@lossendae/vue-table'

What is actually happening?

Any of those imports return undefined


This look like an issue with tree shaking. I tested a bunch of config options locally via the vue.config.js file but to no avail :

module.exports = {
    chainWebpack: config => {
            config.optimization.removeAvailableModules(false)
            config.optimization.concatenateModules(false)
            config.optimization.providedExports(false)
            config.optimization.providedExports(false)
            config.optimization.usedExports(false)
            config.optimization.sideEffects(false)
            config.optimization.minimize(false)
            config.optimization.flagIncludedChunks(false)
    },
}
@yyx990803
Copy link
Member

@lossendae @Patcher56 Make sure to see the commit message of 1dc47eb .

@lossendae
Copy link
Author

It worked like a charm, thank you Evan!

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

2 participants