Skip to content

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

Closed
@weixiao-huang

Description

@weixiao-huang
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions