Javascript can';t导入使用'@情感/核心`
当我在组件中直接使用Javascript can';t导入使用'@情感/核心`,javascript,reactjs,loader,parceljs,emotion,Javascript,Reactjs,Loader,Parceljs,Emotion,当我在组件中直接使用@emotion/core时。它很好用。但每当我想重用该组件(使用@emotion/core)时,我就会得到一个包错误过程未定义 这是我的宝贝 { "plugins": [ "@babel/plugin-transform-modules-commonjs", [ "@babel/plugin-proposal-decorators", { "le
@emotion/core
时。它很好用。但每当我想重用该组件(使用@emotion/core)时,我就会得到一个包错误过程未定义
这是我的宝贝
{
"plugins": [
"@babel/plugin-transform-modules-commonjs",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
["@babel/plugin-proposal-optional-chaining", {}, "chain"],
["@babel/plugin-transform-runtime", { "regenerator": true }],
["emotion"],
[
"module-resolver",
{
"root": ["./src"],
"alias": {
"src": "./src"
}
}
]
],
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
这是我的微调器组件
import React from "react";
import { css } from "@emotion/core";
import BeatLoader from "react-spinners/BeatLoader";
const override = css`
display: block;
margin: 0 auto;
text-align: center;
`;
const Spinner = () => {
return <BeatLoader css={override} size={15} color="#38a169" />;
};
export default Spinner;
从“React”导入React;
从“@emotion/core”导入{css};
从“react spinners/BeatLoader”导入BeatLoader;
const override=css`
显示:块;
保证金:0自动;
文本对齐:居中;
`;
常量微调器=()=>{
返回;
};
导出默认微调器;
问题是,我无法将此微调器组件导入到其他组件