GithubHelp home page GithubHelp logo

Comments (10)

louisgv avatar louisgv commented on May 20, 2024 1

This should be fixed in parcel-bundler/parcel#8189, and since latest plasmo is using parcel 2.6.2 (which includes the fix), I think all you need to do is upgrade plasmo to latest version @deno-source

Also, for this case, you do not need to use the url scheme - it's mainly used in source code. This should work (or at least it did on my machine xD)

    "declarative_net_request": {
      "rule_resources": [
        {
          "id": "ruleset_1",
          "enabled": true,
          "path": "~rulesets/test.json"
        }
      ]
    }

from plasmo.

ColdSauce avatar ColdSauce commented on May 20, 2024

Thanks for the report! We'll look into resolving this soon.

from plasmo.

louisgv avatar louisgv commented on May 20, 2024

Future note: we might want to add this to our documentation

from plasmo.

louisgv avatar louisgv commented on May 20, 2024

doc updated: https://docs.plasmo.com/workflows/faq#tilde-import-resolution

from plasmo.

deno-source avatar deno-source commented on May 20, 2024

This should be fixed in parcel-bundler/parcel#8189, and since latest plasmo is using parcel 2.6.2 (which includes the fix), I think all you need to do is upgrade plasmo to latest version @deno-source

Also, for this case, you do not need to use the url scheme - it's mainly used in source code. This should work (or at least it did on my machine xD)

    "declarative_net_request": {
      "rule_resources": [
        {
          "id": "ruleset_1",
          "enabled": true,
          "path": "~rulesets/test.json"
        }
      ]
    }

That's great! That solved my puzzle! Thank you very much for your answer!

from plasmo.

deno-source avatar deno-source commented on May 20, 2024

doc updated: https://docs.plasmo.com/workflows/faq#tilde-import-resolution

I want to inject a script, using the ~ method does not seem to work, is there any other way, indexJS does not depend on any, this is a separate script

image
image

from plasmo.

louisgv avatar louisgv commented on May 20, 2024

@deno-source https://docs.plasmo.com/workflows/content-scripts#importing-web-accessible-resources (do this in a content script that wake up your background script with the path to the bundled index.js)

from plasmo.

deno-source avatar deno-source commented on May 20, 2024

image

image

I have tried this method but still get errors

from plasmo.

deno-source avatar deno-source commented on May 20, 2024

@deno-source https://docs.plasmo.com/workflows/content-scripts#importing-web-accessible-resources(在内容脚本中执行此操作,该脚本使用捆绑的 index.js 的路径唤醒您的后台脚本)

I use it in background-js

from plasmo.

deno-source avatar deno-source commented on May 20, 2024

@deno-source https://docs.plasmo.com/workflows/content-scripts#importing-web-accessible-resources (do this in a content script that wake up your background script with the path to the bundled index.js)

Also, I don't want this file to be packed and compressed.

from plasmo.

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.