Importing Remote Code
Plasmo automatically bundles all import statements that point to a remote resource using the
https protocol in build time. This is essential to work with the remote code restriction in Manifest V3.
Adding the Google Analytics 4 tracking code into our popup is as simple as:
The code above is not clean due to the presence of the tracking ID. However, since Plasmo parses the import statement, we can use environment variables inside the import. Define the tracking ID in a
Then, use it in your import by prefixing a
$ before its name: