StorYBook

How can I configure Storybook.js Webpack to work with absolute image paths in CSS modules in a Next.js project?

瘦欲@ 提交于 2020-12-12 11:25:05
问题 I am trying to configure Storybook to work with Next.js, Ant Design, Less, and TypeScript. In Next.js, images have to be stored in the public/ folder and referenced with absolute paths to be used throughout the project. I am having trouble configuring the Storybook.js webpack to be able to resolve these absolute image paths. For example, in a CSS module I could have: .testImage { background-image: url('/images/cucumber.png'); background-repeat: no-repeat; background-size: contain; height:

Storybook: Failed to execute 'createElement' on svg files using @svgr/webpack

前提是你 提交于 2020-12-08 06:19:10
问题 My error in the first place is exactly the same as the one described here. I'm using the @svgr/webpack package to import my .svg files as a React component like that: import Shop from './icons/shop.svg' return <Shop /> It works fine on my app but when I tried to do the same in Storybook I get this error: Failed to execute 'createElement' on 'Document': The tag name provided ('static/media/shop.61b51e05.svg') is not a valid name. So I added the loader into my .storybook/main.js file to extends

Storybook: Failed to execute 'createElement' on svg files using @svgr/webpack

时间秒杀一切 提交于 2020-12-08 06:18:56
问题 My error in the first place is exactly the same as the one described here. I'm using the @svgr/webpack package to import my .svg files as a React component like that: import Shop from './icons/shop.svg' return <Shop /> It works fine on my app but when I tried to do the same in Storybook I get this error: Failed to execute 'createElement' on 'Document': The tag name provided ('static/media/shop.61b51e05.svg') is not a valid name. So I added the loader into my .storybook/main.js file to extends

Storybook: Failed to execute 'createElement' on svg files using @svgr/webpack

我只是一个虾纸丫 提交于 2020-12-08 06:18:51
问题 My error in the first place is exactly the same as the one described here. I'm using the @svgr/webpack package to import my .svg files as a React component like that: import Shop from './icons/shop.svg' return <Shop /> It works fine on my app but when I tried to do the same in Storybook I get this error: Failed to execute 'createElement' on 'Document': The tag name provided ('static/media/shop.61b51e05.svg') is not a valid name. So I added the loader into my .storybook/main.js file to extends

记一次给 vue 3.x 搭建脚手架遇到的问题之组件编写

匆匆过客 提交于 2020-11-12 11:56:15
劳动节就好好在家写代码了,毕竟我们现在居家就是在为国家做贡献,而且劳动节不劳动和咸鱼有什么区别,手动🐶保命。 前言 vue 3 刚出几个月,现在是一步一个坑,但是坑还是要填的,毕竟生活还是要继续的么。 目前 vue 3.x 基本上是已经可以工作了,刚出不久的那段时间还看👀到掘金上有人说生产上有 3.x ,对这种大佬只能佩服,毕竟新东西出来,光是想想出了问题,这么解决就是非常头疼的事情 比如我现在搭个脚手架基本就是一路爬过来的,还好目前还没开始深入开发,出的都是周边配套和类型这些小问题。 另外说和 react 很像的,我只能说,这不光是像,你们的代码估计都可以拷过来改改就能用了呢,看下完整的函数式组件的代码 不过 vue 的双向数据绑定用的很舒服,这个才是最主要的,毕竟手写 set 真的麻烦。 读书人的事情这么能叫抄呢?这叫借鉴,这叫共同进步 --- by 鲁迅 不过这种事情其实说多了也没意义,比如 python 和 js 或其他语言之间,你敢说没有互相借鉴。 而且前端的口号不就是:“走别人的路,让别人无路可走”,我们要团结一致,毕竟前端这个岗位真的很容易被替代掉,我们求发展,求稳定,技术人用实力说话,才能让这个岗位越走越远。 目前的脚手架的开发进度 基本上已经可以支持你跑,但是打包工具还在纠结,我喜欢 rollupjs,但是项目已经引入了 webpack,到底要不要再引一个新的