Giter Site home page Giter Site logo

shgysk8zer0 / rollup-import Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 580 KB

A RollUp plugin for importing modules

Home Page: https://www.npmjs.com/package/@shgysk8zer0/rollup-import

License: MIT License

JavaScript 100.00%
import-map node rollup-plugin

rollup-import's Introduction

Hi there ๐Ÿ‘‹

My name is Chris, and I write code and stuff. All of the cool kids were creating this fancy profile thing by adding a README.md to their profiles, so I decided to join the crowd. Try it out yourself here.


Contact or Follow Me here ๐Ÿ‘‡

GitHub followers Twitter Follow

Appointment LinkedIn

rollup-import's People

Contributors

dependabot[bot] avatar shgysk8zer0 avatar

Watchers

 avatar  avatar

rollup-import's Issues

Sourcemap for local files is absolute path

Describe the bug
If scripts use import.meta and are local files, the soucemap contains the absolute filepath.
e.g. /home/${username}/Projects/${project}/${path}

To Reproduce
Steps to reproduce the behavior:

  1. Use import.meta.url or import.meta.resolve() in a local script
  2. Run rollup with rollupImport() and rollupImportMeta()
  3. Open in a browser
  4. See sources/Debugger panel

Expected behavior
The source should not be file://...

Additional context
Need to get back the original id or something, not use the transformed id

Not compatible with Windows file paths

Having the following configuration:

// after imports (dotenv etc)...
export default {
    input: 'libs/generative.js',
    plugins: [
        rollupImport(['importmap.json']),
        rollupImportMeta({
        // MUST be a valid URL
            baseURL: 'https://mylinks.space/', // Defaults to `process.env.URL` if set
            // MUST be a `file:` URL
            // projectRoot: './', // Dfaults to `file:///${process.cwd()}/`
        }),
        terser(),
    ],
    output: {
        file: 'dest/generative.js',
        format: 'iife'
    }
}

I followed documentation and I'm having such error:

Error: Could not load file:///C:/Users/Administrator/Documents/mylinks/libs/generative.js: ENOENT: no such file or directory, open 'C:\C:\Users\Administrator\Documents\mylinks\libs\generative.js'
Error: Could not load file:///C:/Users/Administrator/Documents/mylinks/libs/generative.js: ENOENT: no such file or directory, open 'C:\C:\Users\Administrator\Documents\mylinks\libs\generative.js

It looks like there is a bug: C:\C:\
(I'm on windows by the way)

Thanks a lot

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.