Giter VIP home page Giter VIP logo

Comments (6)

matthew-dean avatar matthew-dean commented on June 14, 2024 2

Related: even using @rollup/plugin-node-resolve, I couldn't get this plugin / SWC to resolve index files, like: ./src/ui/Button/index.ts when using

import { Button } from '@ui/Button'

Is this a SWC issue, and regardless, is there a way to get SWC to resolve paths using other rollup plugins? It doesn't seem like module resolution in SWC uses the Rollup flow to resolve paths.

from rollup-plugin-swc.

mentaljam avatar mentaljam commented on June 14, 2024 1

Hi,

Sorry for not responding for so long. What about using @rollup/plugin-node-resolve like in the example?

from rollup-plugin-swc.

abenz1267 avatar abenz1267 commented on June 14, 2024

didn't wanna open up a new issue... so i'm hijacking this as it's SOMEWHAT related.

I can't build, because imports are missing the *.ts extension, which Typescript omits by default. I'd like to keep it that way. How can i make SWC resolve those imports correctly? Or do i have to add the extension to every import now?

If i add extensions: ['.ts'], to the nodeResolve plugin like in the example, it can't resolve node_modules imports. Tries to resolve "repeat.ts" instead of "repeat.js" as in the actual import.

from rollup-plugin-swc.

mentaljam avatar mentaljam commented on June 14, 2024

@abenz1267, have you tried extensions: ['.js', '.ts']?

from rollup-plugin-swc.

abenz1267 avatar abenz1267 commented on June 14, 2024

from rollup-plugin-swc.

matthew-dean avatar matthew-dean commented on June 14, 2024

Any update on this? Ideally, it should not require @rollup/plugin-node-resolve for relative files.

from rollup-plugin-swc.

Related Issues (4)

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.