我有一些错误:
糟糕,我们坠毁了 找不到模块“椭圆形” 堆栈跟踪.............
此处是我的组件
import React from 'react'
import { css } from '@emotion/core'
import { Background, Color } from 'Utils'
import PropTypes from 'prop-types'
const Badge = ({ color, children, style, ...props }) => {
const badge = css`font-size: 9px; letter-spacing: 1px; color: ${ Color.white }; border-radius: 10px; padding: 2px 7px; vertical-align: middle; display: inline-block; font-weight: bold;`
return (
<div css={ [badge, Background(color), style] } { ...props }>{ children }
)
}
Badge.propTypes = {
color: PropTypes.string,
children: PropTypes.node,
style: PropTypes.string
}
export default Badge
我的doczrc.js配置
`import { alias } from './next.config'
export default {
title: 'Reactism',
description: 'Reactism is a React Boilerplate based next.js',
modifyBundlerConfig: config => {
console.log("alias",alias)
const newConfig = {
...config,
resolve: {
...config.resolve,
alias: {
...config.resolve.alias,
...alias
}
},
module: {
rules: [
...config.module.rules,
{
test: /.css$/,
use: ['css-loader']
}
]
}
}
return newConfig
}
}
**和next.config.js上的别名**
const aliases = { 'Containers': path.resolve(__dirname, 'components/containers'), 'Elements': path.resolve(__dirname, 'components/elements/'), 'Utils': path.resolve(__dirname, 'components/utilities/'), 'Layout': path.resolve(__dirname, 'components/pageLayouts/'), ................... }
任何人都可以帮忙吗?