{"id":15984657,"url":"https://github.com/aappddeevv/scalajs-friendly-source-map-loader","last_synced_at":"2025-03-18T00:31:30.759Z","repository":{"id":97610047,"uuid":"130079662","full_name":"aappddeevv/scalajs-friendly-source-map-loader","owner":"aappddeevv","description":"Drop in replacement for webpack's source-map-loader that understands file:// and http[s]:// sources in scala.js generated source map files.","archived":false,"fork":false,"pushed_at":"2020-05-11T12:17:25.000Z","size":8,"stargazers_count":9,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-30T00:03:28.674Z","etag":null,"topics":["loaders","scala","scalajs","webpack"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aappddeevv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-18T15:01:01.000Z","updated_at":"2022-01-12T04:06:01.000Z","dependencies_parsed_at":"2023-04-20T19:31:58.412Z","dependency_job_id":null,"html_url":"https://github.com/aappddeevv/scalajs-friendly-source-map-loader","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"7adc11c86b137750205bff27a05af5d8d7ac2a09"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fscalajs-friendly-source-map-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fscalajs-friendly-source-map-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fscalajs-friendly-source-map-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fscalajs-friendly-source-map-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aappddeevv","download_url":"https://codeload.github.com/aappddeevv/scalajs-friendly-source-map-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243893849,"owners_count":20364918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["loaders","scala","scalajs","webpack"],"created_at":"2024-10-08T02:10:00.821Z","updated_at":"2025-03-18T00:31:30.469Z","avatar_url":"https://github.com/aappddeevv.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![npm](https://img.shields.io/npm/v/scalajs-friendly-source-map-loader)\n\nDrop in replacement for source-map-loader but this loader understands `file://`\nand `http[s]://` prefixes in source map files like the kind you find in scala.js\ngenerated source maps. It is often recommended that scala.js resources\nuse the `-P:scalajs:mapSourceURI` option to set their source maps to\ngithub resources since there is no stable mechanism to include them in jars.\n\nIncluding scala sources increases the map size so use `bundleHttp: false` to not\nbundle them. They are bundled by default. Warnings that \"file://\" resources\ncannot be found can be turned off using `skipFileURLWarnings` which is true by\ndefault. If you depend on other scala.js libraries, they may have `file://`\nlinks embedded that cause warnings. If you work offline and do not have access\nto http resources, then set your\n`bundleHttp` option using a nodejs environment variable: `bundleHttp:\nprocess.env.OFFLINE` and set the environment variable `OFFLINE=\"true\"` before\nyou run webpack. Note that \"true\" is in quotes to make at a string environment\nvariable.\n\nFetched resources are cached. The default cache directory is `\u003ccwd\u003e/.scala-js-sources`.\nWebpack already caches source maps so this cache mostly helps with \ncold starts.\n\nAs a drop-in replacement:\n```javascript\n...\n            {\n                test: /\\.js$/,\n                // use loader defaults\n                use: [\"scalajs-friendly-source-map-loader\"],\n                // set options explicitly\n                use: [\n                { \n                    loader: \"scalajs-friendly-source-map-loader\",\n                    options: {\n                        skipFileURLWarnings: true, // or false, default is true\n                        bundleHttp: true // or false, default is true,\n\t\t\tcachePath: \".scala-js-sources\", // cache dir name, exclude in .gitignore\n\t\t\tnoisyCache: false, // whether http cache changes are output\n                        useCache: true, // false =\u003e remove any http cache processing\n                    }\n                }],\n                enforce: \"pre\",\n            },\n```\n\nTo use in your loaders *only* for your scalajs output:\n\n```javascript\n...\n            {\n                test: /\\.js$/,\n                use: [\n                  { \n                      loader: \"scalajs-friendly-source-map-loader\"\n                      options: {\n                        bundleHttp: false // or use the short version above\n                       },\n                  }],\n                enforce: \"pre\",\n                include: [scalapath],\n            },\n            {\n                test: /\\.js$/,\n                use: [\"source-map-loader\"],\n                enforce: \"pre\",\n                // does not handle scala.js issued https: remote resources\n                exclude: [/node_modules/, scalapath],\n            },\n...\n```\n\nLoaders are used right to left so the normal source-map-loader will run first\nbut *ignore* the scala.js output leaving the scala js file to the friendly\nloader. `scalapath` is a resolved path to your scala.js compiler output file.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faappddeevv%2Fscalajs-friendly-source-map-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faappddeevv%2Fscalajs-friendly-source-map-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faappddeevv%2Fscalajs-friendly-source-map-loader/lists"}