Skip to content

TypeScript library build using entry show warnings #1641

@Gnuk

Description

@Gnuk

Version

3.0.0-rc.3

Reproduction link

https://github.com/Gnuk/vue-typescript-build

Steps to reproduce

Generate a Vue.js application using @vue/cli 3.0.0-rc.3

Use the following plugins:

  • Babel
  • TypeScript
  • Mocha + Chai
  • Lint

Add follogind lines inside package.json :

  "main": "dist/example.common.js",
  "typings": "src/index.ts",
  "scripts": {

    "build:lib": "vue-cli-service build --target lib --name example 'src/index.ts'",

Inside the src/index.ts file add :

export * from './components';

Inside the src/components/index.ts file add :

// @ts-ignore
import HelloWorld from './HelloWorld.vue';
export {HelloWorld};

The ts-ignore is used because TypeScript don't recognize vue file as a module

Launch npm run build:lib

What is expected?

No Warning

What is actually happening?

Warnings :

  Building for production as library (commonjs + umd)...

 WARNING  Compiled with 1 warnings                                                                                                                                                                                          19:20:47

 warning  in ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js

"export 'default' (imported as 'mod') was not found in '~entry'



 WARNING  Compiled with 1 warnings                                                                                                                                                                                          19:20:47

 warning  in ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js

"export 'default' (imported as 'mod') was not found in '~entry'



 WARNING  Compiled with 1 warnings                                                                                                                                                                                          19:20:47

 warning  in ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js

"export 'default' (imported as 'mod') was not found in '~entry'

I've no problems when importing my component (or more than one component) inside another Vue.js application as a module.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions