从单独的模块导入部分情感样式会产生不正确的结果,但是从文件作品中导入

问题描述 投票:0回答:1

我正在使用Webpack和Babel,我有很多经验,但是我不知道这里可能会发生什么。我要从中导入的主项目和模块都在单个Lerna monorepo中,并且都具有相同的.babelrc配置。 Babel配置包括babel-plugin-emotion

这里是部分样式:

import { css } from 'emotion';
export const zoomPartial = css`
  zoom: 0.9;
`;

当我这样导入部分时,我得到正确的输出:

import { zoomPartial } from './partials';

enter image description here

但是当我这样导入时,得到的输出不正确:

import { zoomPartial } from 'partials-module';

enter image description here

javascript webpack babel styled-components emotion
1个回答
0
投票

我是从'emotion'而不是'@ emotion / core'导入css

© www.soinside.com 2019 - 2024. All rights reserved.