Coder Social home page Coder Social logo

Comments (4)

jpanduro-blackbird avatar jpanduro-blackbird commented on May 18, 2024 1

I think the following config is already doing the minification by lines

jsc: {
    minify: { sourceMap: true }
  },
  minify: true,

Our intent is to not include ua-parser-js library in the bundle in certain cases because of its size. For those purposes we were using @rollup/plugin-alias, which replace it with mocked module, that returned null. And this plugin stopped working after starting using rollup-plugin-swc3

Is there any idea how I can solve this problem?

from rollup-plugin-swc.

SukkaW avatar SukkaW commented on May 18, 2024

rollup-plugin-swc3 acts more as an alternative to @rollup/plugin-typescript rather than rollup-plugin-terser. If you intend to replace terser, you could import swcMinify from rollup-plugin-swc3 instead.

from rollup-plugin-swc.

SukkaW avatar SukkaW commented on May 18, 2024

Is there any idea how I can solve this problem?

Could you provide a minimum reproduction so I can pinpoint the issue?

rollup-plugin-swc3 has implemented a customized module resolving to work with TypeScript files while @swc/core can expand aliased imports during the transformation. Although I suspect that this might be the cause of the issue, I can't rectify it without a minimal reproduction.

In the meantime, swcMinify doesn't include a customized module resolving and swc transformation. Therefore simply importing swcMinify from rollup-plugin-swc3 might be the quickest workaround for this issue.

from rollup-plugin-swc.

jpanduro-blackbird avatar jpanduro-blackbird commented on May 18, 2024

Thanks for suggestions! Basically, I was able to achieve it by using rollup-plugin-ignore instead

from rollup-plugin-swc.

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.