Giter VIP home page Giter VIP logo

Comments (1)

toplyb avatar toplyb commented on September 27, 2024

Steps to reproduce

在 React18 中,已安装 @farmfe/js-plugin-less 插件,插件配置如下:

import { defineConfig } from '@farmfe/core';
import farmJsPluginLess from '@farmfe/js-plugin-less'
import * as path from 'node:path'

export default defineConfig({
  plugins: ['@farmfe/plugin-react', farmJsPluginLess()],
  compilation: {
    resolve: {
      alias: {
        '/@': path.join(process.cwd(), 'src')
      }
    }
  }
});

然后当我在 index.tsx 中使用下面命令引入 less 的时候,提示Can not resolve @/css/init.less from src/index.tsx.,代码如下:

import { Container, createRoot } from 'react-dom/client'
import '@/css/init.less'
import { Main } from './main';


const container = document.querySelector('#root') as Container;
const root = createRoot(container);

root.render(<Main />);

麻烦指教下这块应该怎么处理

Reproduce link

No response

What is actually happening?

引入 less 文件后,提示 Can not resolve @/css/init.less from src/index.tsx

System Info

System: macOS 13.0.1
npm: 19.0.1

from farm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.