GithubHelp home page GithubHelp logo

Comments (3)

worldzhao avatar worldzhao commented on May 21, 2024

sideEffects字段是为了做组件库的tree shaking,用户生产环境打包的时候会移除掉引用但未使用的文件(style.ts当然属于此类),由于只配置了lib esmdist三个文件夹,故这三个文件夹下面不会删除。

我们的文档项目也相当于一个应用程序,所以把自己的样式给摇掉了...可以:

  • 删除掉sideEffects字段(毕竟使用了babel-plugin-import,显得sideEffects有些鸡肋)
  • sideEffects字段增加components/**/style/**等文件夹,避免删除其内样式,但作为npm包这个配置是多余的,只是为了文档样式不丢失,不如全删掉

由于我在公司内部使用的css in js方案所以不会出现这种情况(不会存在引用但未使用的脚本文件),的确是我疏忽了,感谢提问指出问题。

from react-ui-library-tutorial.

18518300669 avatar 18518300669 commented on May 21, 2024

果然,如你所说,是这个问题导致的。关于这个问题,我的思路一直想偏了,一直在寻找docz的本地和开发的差异。
非常感谢,困扰我好几天了。
地址发来,外卖奶茶奉上。

from react-ui-library-tutorial.

worldzhao avatar worldzhao commented on May 21, 2024

果然,如你所说,是这个问题导致的。关于这个问题,我的思路一直想偏了,一直在寻找docz的本地和开发的差异。
非常感谢,困扰我好几天了。
地址发来,外卖奶茶奉上。

哈哈,本来就是我没写清楚,仓库代码也有问题,不用不用啦,能帮到你就好!

from react-ui-library-tutorial.

Related Issues (20)

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.