Git Product home page Git Product logo

rookie-components's Introduction

问题1

执行 npm run build:components 打包组件 报错信息: [vite:vue] Illegal tag name. Use '<' to print '<'.

报错文件: file:/element-plus-ui-library/packages/components/Progress/src/index.vue

github上找到相关的链接: 地址

问题2

执行npm run build:componentsnpm run build:components2 这两个命令的时候(后面分别用componentscomponents2区分),分别执行的是 command目录下的 build.tsbuild.js 我配置的命令是一样的,但是执行出来的结果完全不同

如果我执行的是 build:components2就不会出现上面 问题1的问题,并且能够成功的引入生成的js文件,看了下主要的区别:

看了打包的后文件的区别: 执行components后生成的文件lib目录下: 文件的内容很少

const _sfc_main$ = {} // 组件对应的代码

执行components2后: 文件的内容多了很多, 并且组件相关的代码如下

import { defineComponent } from 'vue'
const _sfc_main$5 = defineComponent({ ... }) // 每个组件都会有defineComponent包裹起来

原因是为什么?

注意

打包后的文件,可以放在src/main.ts目录下引入,测试看效果

rookie-components's People

Contributors

rookie-hhm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.