Skip to content

🐛没有使用 less-loader 的项目中编译失败 #3088

Open
@linwrui

Description

@linwrui

🏷 S2 Version / S2 版本

Package Version
@antv/s2 2.1.10
@antv/s2-react -
@antv/s2-react-components -

💻 Sheet Type / 表格类型

  • PivotSheet
  • TableSheet
  • PivotChartSheet
  • GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Describe the bug / 问题描述

报错信息如下:

ERROR in ./node_modules/@antv/s2-next/esm/ui/tooltip/index.less 1:0
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> @import '../../styles/variables.less';
| @import '../../styles/theme/dark.less';
|
 @ ./node_modules/@antv/s2-next/esm/ui/tooltip/index.js 4:0-22
 @ ./node_modules/@antv/s2-next/esm/index.js
 @ ./node_modules/@storybook/vue/node_modules/ts-loader??ref--3-0!./node_modules/ts-loader??ref--14!./node_modules/vue-loader/lib??vue-loader-options!./packages/S2-table-renderer/components/s2-table-instance.vue?vue&type=script&lang=ts&
 @ ./packages/S2-table-renderer/components/s2-table-instance.vue?vue&type=script&lang=ts&
...

溯源文件是 tooltip/index.js 文件引入了 less 样式文件导致的,但是我的项目使用 scss ,没有引入 less-loader ,是否有其他办法能避免引入新的 loader 并且能正常编译

⌨️ Code Snapshots / 代码片段

ERROR in ./node_modules/@antv/s2-next/esm/ui/tooltip/index.less 1:0
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> @import '../../styles/variables.less';
| @import '../../styles/theme/dark.less';
|
 @ ./node_modules/@antv/s2-next/esm/ui/tooltip/index.js 4:0-22
 @ ./node_modules/@antv/s2-next/esm/index.js
 @ ./node_modules/@storybook/vue/node_modules/ts-loader??ref--3-0!./node_modules/ts-loader??ref--14!./node_modules/vue-loader/lib??vue-loader-options!./packages/S2-table-renderer/components/s2-table-instance.vue?vue&type=script&lang=ts&
 @ ./packages/S2-table-renderer/components/s2-table-instance.vue?vue&type=script&lang=ts&
...

🔗 Reproduction link / 复现链接

No response

📋 Steps to Reproduce the Bug or Issue / 重现步骤

在没有使用 less-loader 的项目中引入 s2 v2.x ,编译项目即可复现

😊 Expected Behavior / 期望行为

正常编译

😅 Current Behavior / 当前行为

No response

💻 OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

🌏 Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他

Metadata

Metadata

Assignees

No one assigned

    Labels

    next2.0-next 版本的问题💤 inactive不活跃的 Issue 或 PR, 30天没有回复

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions