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

vue-cli-3.0 rc.8 typescript 模板按需引入组件的时候出现 warning #87

Closed
1 task done
weixiao-huang opened this issue Jul 29, 2018 · 1 comment
Closed
1 task done

Comments

@weixiao-huang
Copy link

weixiao-huang commented Jul 29, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.0.1

Environment

MacOS 10.13.6, node 10.7.0, yarn 1.9.2

Reproduction link

https://github.com/weixiao-huang/vue-antd-ui-demo

Steps to reproduce

yarn
yarn serve

What is expected?

no warning's like below:

No type errors found
Version: typescript 2.9.2
Time: 3802ms

App running at:
- Local:   http://localhost:8080/
- Network: http://192.168.1.103:8080/

Note that the development build is not optimized.
To create a production build, run yarn build.

What is actually happening?

WARNING  Compiled with 1 warnings

warning  in ./node_modules/vue-antd-ui/es/dropdown/index.js

"export 'DropDownProps' was not found in './dropdown'

No type errors found
Version: typescript 2.9.2
Time: 3802ms

App running at:
- Local:   http://localhost:8080/
- Network: http://192.168.1.103:8080/

Note that the development build is not optimized.
To create a production build, run yarn build.


I use vue-cli-3.0 rc.8 to create the project:

vue create test2

except pwa, I select all options, and config as below

Vue CLI v3.0.0-rc.8
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, TS, Router, Vuex, CSS Pre-processors, Linter, Unit, E2E
? Use class-style component syntax? Yes
? Use Babel alongside TypeScript for auto-detected polyfills? Yes
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Stylus
? Pick a linter / formatter config: Airbnb
? Pick additional lint features: Lint on save
? Pick a unit testing solution: Jest
? Pick a E2E testing solution: Nightwatch
? Where do you prefer placing config for Babel, PostCSS, ESLint, etc.? In dedicated config files
? Save this as a preset for future projects? Yes

And I use babel-plugin-import

yarn add babel-plugin-import --dev

and add config into babel.config.js

module.exports = {
presets: [
'@vue/app',
],
plugins: [
'transform-vue-jsx',
'@babel/transform-runtime',
['import', { libraryName: 'vue-antd-ui', libraryDirectory: 'es', style: 'css' }]
]
};

Then add some components into main.ts, I will get the warnings. Details can be found in the project I provide above

tangjinzhou added a commit that referenced this issue Jul 29, 2018
tangjinzhou added a commit that referenced this issue Sep 5, 2018
@lock
Copy link

lock bot commented Aug 5, 2019

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 5, 2019
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