Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Miguel Camba
    @cibernox
    that makes me think my plugins are not running in the other I expected them to, but not sure why or how to fix it
    to clarify, there are two problem there. 1) It think that the library is external and tries to pass it in. 2) Seems that the functions used from those transformed files are not picked by the bundling process
    Peter Todd
    @xinaesthete
    @David-Else You should be able to fairly easily watch your css file and copy it when it changes. If you want to integrate that with your rollup configuration, perhaps invoke rollup from the Javascript API https://rollupjs.org/guide/en/#javascript-api and have another separate bit of code that just watches and copies your file (with Node fs module).
    Luca Ban
    @mesqueeb_gitlab

    Hi noob question here! :D
    I wonder how I should decide when making an npm module for usage in other projects (eg. a single Vue component)
    wether or not I should mark dependencies as external.

    Should I do:

    const external = Object.keys(pkg.dependencies || [])

    or not? What's the mindset of marking something as an external?

    ELLIOTTCABLE
    @ELLIOTTCABLE
    I'm trying to produce two output distributions (pretty standard: one CJS, one ES6-modules) with rollup. My entry-file has several named-exports, and then a default-export that's a 'bag of functions' with a few of those named exports.
    (i.e. something like export class Foo …, export class Bar, and export function widget() { … }; with a final export default { Foo, Bar })
    My Rollup config has something like:
       output: [
          {
             file: 'dist/interface.js',
             format: 'cjs',
             exports: 'default',
          },
          {
             file: 'dist/interface.esm.js',
             format: 'esm',
          },
       ],

    Unfortunately, I'm getting this error:

    [!] Error: "default" was specified for "output.exports", but entry module "src/interface.ts" has the following exports: AutomatonElement, AutomatonStack, Checkpoint, Expression, ExpressionEval, LexBuffer, LexError, LocatedToken, OCamlError, ParseError, Parser, Position, Script, Token, default

    I'd like to only export the { Foo, Bar }-style "bag of functions" to cjs consumers; but allow ESM consumers (not least, another package of my own, heh) the option of named-importing various minutiae that aren't actually part of the public, documented API.
    I'm not sure why Rollup is yelling at me for saying "for my exports, choose the 'default' property only", am I mis-reading the documentation for output.exports?
    trbrc
    @trbrc
    hey!
    i would like to add a check to my build that checks whether certain debugging code appears the bundle or not, to avoid accidentally including it in production
    treeshaking and minification makes me a little unsure of the best way to do it. is there some kind of plugin or something that makes this easier?
    matrixbot
    @matrixbot
    eruigivmmzpoir8159vmt0-3ajk Yes.
    trbrc
    @trbrc
    hm, no... that helps removing code, but I want to verify that it's actually been removed in a bundle with a complex dependency graph
    matrixbot
    @matrixbot
    eruigivmmzpoir8159vmt0-3ajk Hm...
    trbrc
    @trbrc
    I was thinking if I add something like window.VERIFY_REMOVED = 'FAILED'; or something to any code that I expect wouldn't be in the final bundle, then simply search through the output for 'VERIFY_REMOVED'.
    matrixbot
    @matrixbot
    eruigivmmzpoir8159vmt0-3ajk I do not know a solution for rollup. Is stripping it not good enough?
    trbrc
    @trbrc
    stripping is good, that's what I want to do, but its easy to accidentally import a debugging utility somewhere and forget to add the right conditional check before.
    do that in a single place, and a large amount of debugging code makes it into production.
    so I want the production build to basically fail if certain input code makes it all the way through.
    matrixbot
    @matrixbot
    eruigivmmzpoir8159vmt0-3ajk What about this? https://github.com/proteriax/rollup-plugin-ignore
    eruigivmmzpoir8159vmt0-3ajk Not sure how well that works though.
    trbrc
    @trbrc
    that might be an option, thanks! i'll see if I can make it do what I want
    trbrc
    @trbrc
    I found a pretty good solution, using the onAnalysis hook in github.com/doesdev/rollup-plugin-analyzer to verify that certain files have a 0 byte output
    matrixbot
    @matrixbot
    eruigivmmzpoir8159vmt0-3ajk Oh.
    eruigivmmzpoir8159vmt0-3ajk That's interesting.
    Sasha Firsov
    @SashaFirsov_twitter
    Trying to marry CDN and web app. To do so a) some import packages should be mapped to URLs b) libs have to be built without bundling.
    Question: how to disable bundling and tree shaking?
    Question: how to map some packages to CDN URLs?
    Sasha Firsov
    @SashaFirsov_twitter
    Duarte Nunes
    @duarten
    is there a way to have rollup show a list of all circular dependencies?
    Miguel Camba
    @cibernox
    Is there anyone here familiar with rollup + babel? I'm created a babel plugin that transpiles certain files and adds a few import { a,b } from 'some-npm-package'; at the beginning of those files, and now I'm wrapping it in a rollup plugin, but I'm facing some issues. Apparently I don't seem to be able to run the app in both the browser and in node for testing it with jest. i either don't transpile modules and the app runs in the browser, or I transpile it and it runs runs in jest but can't find the "some-npm-package"
    everything is open source, so I can show every bit of the code
    Walle Cyril
    @GrosSacASac
    do you use the babel plugin
    Miguel Camba
    @cibernox
    I do
    I believe I have a poor understanding of module formats and how they interoperate
    Walle Cyril
    @GrosSacASac
    The order is wrong, you need to add imports before rollup resolves.
    Will Nixon
    @willnix86
    Potentially dumb question: do I need to do anything in rollup to ensure that mywebpage.com/subpage opens subpage.html in the public folder? At the moment, if I go to mywebpage.com/subpage in production it just reopens index.html, whereas in development it works as expected
    Walle Cyril
    @GrosSacASac
    rollup is not for html
    Will Nixon
    @willnix86
    Ok cool, just checking I didn't need to do anything on this end
    Oliver Williams
    @o-t-w
    What is the best way to enable CSS/Sass loading for a shared React component library?
    Oliver Williams
    @o-t-w
    Somebody else has the exact same question on Stack Overflow and there are no answers :( https://stackoverflow.com/questions/56874995/inject-per-component-style-tags-dynamically-with-rollup-and-scss
    Walle Cyril
    @GrosSacASac
    IT is the end of stackoverlow
    nobody cares about fake internet points anymore
    Mark Hughes (happybeing)
    @theWebalyst
    Next... SolidAnswers!
    Oops, wrong gitter. Thought I was in the Solid chat :blush:
    Maxim Topciu
    @maximtop

    Hi! Is it possible to run both configs every time there are changes that happen in one of the modules?

    Here is the config.

    https://github.com/AdguardTeam/Scriptlets/blob/master/rollup.config.js

    It consists of two configs

    [bundleBuild, testBuild]

    When I launch rollup with --watch argument, it rebuilds only files related to one of the configs.

    Alberto Preciado
    @albertopfunk
    Hello everyone! I created a rollup plugin, my very first OSS :D
    Hoping to get some feedback on it - https://github.com/albertopfunk/rollup-plugin-fresh
    Still needs testing, I've only done manual testing, so far it has been working great for me!