我正在尝试从我的nextjs-generic-landing-page制作一个易于使用的 NPM 包,而 NPM 现在位于https://www.npmjs.com/package/nextjs-generic-landing-page
由于某种原因,使用的组件styled-jsx
不起作用,它们呈现奇怪并产生警告:
index.js:1 Warning: Received `true` for a non-boolean attribute `jsx`.
If you want to write it to the DOM, pass a string instead: jsx="true" or jsx={value.toString()}.
in style
in div
in SocialSharing (at pages/index.js:32)
…
这是我使用 Babel 构建 NPM 包的代码:
"publish:npm": "rm -rf dist && for folder in {components,lib,config,public}; do mkdir -p dist/${folder} && babel ${folder} -d dist/${folder} --copy-files --presets=@babel/preset-env,next; done && cp package.json dist/"
有小费吗?