{"id":13827724,"url":"https://github.com/webpack-contrib/script-loader","last_synced_at":"2025-07-09T05:30:27.992Z","repository":{"id":2942266,"uuid":"3955153","full_name":"webpack-contrib/script-loader","owner":"webpack-contrib","description":"[deprecated] Script Loader","archived":true,"fork":false,"pushed_at":"2019-11-05T13:53:35.000Z","size":88,"stargazers_count":326,"open_issues_count":6,"forks_count":44,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-06-13T00:06:25.440Z","etag":null,"topics":["webpack-loader"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webpack-contrib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-04-07T02:16:16.000Z","updated_at":"2024-10-30T16:29:51.000Z","dependencies_parsed_at":"2022-07-19T02:32:16.204Z","dependency_job_id":null,"html_url":"https://github.com/webpack-contrib/script-loader","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/webpack-contrib/script-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Fscript-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Fscript-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Fscript-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Fscript-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webpack-contrib","download_url":"https://codeload.github.com/webpack-contrib/script-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Fscript-loader/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260805018,"owners_count":23065638,"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":["webpack-loader"],"created_at":"2024-08-04T09:02:06.141Z","updated_at":"2025-07-09T05:30:27.617Z","avatar_url":"https://github.com/webpack-contrib.png","language":"JavaScript","readme":"[![npm][npm]][npm-url]\r\n[![node][node]][node-url]\r\n[![deps][deps]][deps-url]\r\n[![chat][chat]][chat-url]\r\n\r\n# ! NO LONGER MAINTAINED !\r\n\r\nThis module is deprecated and will no longer be maintained.\r\n\r\nIt has a known issue of generating non-deterministic hashes (see #49, #56, #60). \r\n*Do not use it.*\r\n\r\nIn most cases, you can replace the functionality by using `raw-loader` instead:\r\n\r\n```diff\r\n- import('script-loader!someScript.js')\r\n+ import('raw-loader!someScript.js').then(rawModule =\u003e eval.call(null, rawModule.default))\r\n```\r\n\r\nIf you need some transformations to be applied to the script you want to load, you may need to find or write yourself a separate loader for that. Some documentation that might be helpful:\r\n\r\n- https://webpack.js.org/loaders/\r\n- https://webpack.js.org/concepts/loaders/\r\n- https://webpack.js.org/contribute/writing-a-loader/\r\n\r\n----------\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n  \u003ca href=\"https://github.com/webpack/webpack\"\u003e\r\n    \u003cimg width=\"200\" height=\"200\"\r\n      src=\"https://webpack.js.org/assets/icon-square-big.svg\"\u003e\r\n  \u003c/a\u003e\r\n  \u003ch1\u003eScript Loader\u003c/h1\u003e\r\n\u003c/div\u003e\r\n\r\n\u003ch2 align=\"center\"\u003eInstall\u003c/h2\u003e\r\n\r\n```bash\r\nnpm install --save-dev script-loader\r\n```\r\n\r\n\u003ch2 align=\"center\"\u003eUsage\u003c/h2\u003e\r\n\r\nExecutes JS script once in global context.\r\n\r\n\u003e :warning: Doesn't work in NodeJS\r\n\r\n### Config (recommended)\r\n\r\n```js\r\nimport './script.exec.js';\r\n```\r\n\r\n**webpack.config.js**\r\n```js\r\nmodule.exports = {\r\n  module: {\r\n    rules: [\r\n      {\r\n        test: /\\.exec\\.js$/,\r\n        use: [ 'script-loader' ]\r\n      }\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\n### Inline\r\n\r\n```js\r\nimport 'script-loader!./script.js';\r\n```\r\n\r\n## Options\r\n\r\n|                    Name                     |         Type          |     Default     | Description                                 |\r\n| :-----------------------------------------: | :-------------------: | :-------------: | :------------------------------------------ |\r\n|        **[`sourceMap`](#sourcemap)**        |      `{Boolean}`      |     `false`     | Enable/Disable Sourcemaps\r\n|        **[`useStrict`](#usestrict)**        |      `{Boolean}`      |     `true`      | Enable/Disable useStrict\r\n\r\n\r\n### `sourceMap`\r\n\r\nType: `Boolean`\r\nDefault: `false`\r\n\r\nTo include source maps set the `sourceMap` option.\r\n\r\n**webpack.config.js**\r\n```js\r\nmodule.exports = {\r\n  module: {\r\n    rules: [\r\n      {\r\n        test: /\\.script\\.js$/,\r\n        use: [\r\n          {\r\n            loader: 'script-loader',\r\n            options: {\r\n              sourceMap: true,\r\n            },\r\n          },\r\n        ]\r\n      }\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\n### `useStrict`\r\n\r\nType: `Boolean`\r\nDefault: `true`\r\n\r\nTo disable use strict set the `useStrict` option to `false`.\r\n\r\n**webpack.config.js**\r\n```js\r\nmodule.exports = {\r\n  module: {\r\n    rules: [\r\n      {\r\n        test: /\\.script\\.js$/,\r\n        use: [\r\n          {\r\n            loader: 'script-loader',\r\n            options: {\r\n              useStrict: false,\r\n            },\r\n          },\r\n        ]\r\n      }\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\n\r\n\u003ch2 align=\"center\"\u003eMaintainers\u003c/h2\u003e\r\n\r\n\u003ctable\u003e\r\n  \u003ctbody\u003e\r\n    \u003ctr\u003e\r\n      \u003ctd align=\"center\"\u003e\r\n        \u003cimg width=\"150\" height=\"150\"\r\n        src=\"https://avatars3.githubusercontent.com/u/166921?v=3\u0026s=150\"\u003e\r\n        \u003c/br\u003e\r\n        \u003ca href=\"https://github.com/bebraw\"\u003eJuho Vepsäläinen\u003c/a\u003e\r\n      \u003c/td\u003e\r\n      \u003ctd align=\"center\"\u003e\r\n        \u003cimg width=\"150\" height=\"150\"\r\n        src=\"https://avatars2.githubusercontent.com/u/8420490?v=3\u0026s=150\"\u003e\r\n        \u003c/br\u003e\r\n        \u003ca href=\"https://github.com/d3viant0ne\"\u003eJoshua Wiens\u003c/a\u003e\r\n      \u003c/td\u003e\r\n      \u003ctd align=\"center\"\u003e\r\n        \u003cimg width=\"150\" height=\"150\"\r\n        src=\"https://avatars3.githubusercontent.com/u/533616?v=3\u0026s=150\"\u003e\r\n        \u003c/br\u003e\r\n        \u003ca href=\"https://github.com/SpaceK33z\"\u003eKees Kluskens\u003c/a\u003e\r\n      \u003c/td\u003e\r\n      \u003ctd align=\"center\"\u003e\r\n        \u003cimg width=\"150\" height=\"150\"\r\n        src=\"https://avatars3.githubusercontent.com/u/3408176?v=3\u0026s=150\"\u003e\r\n        \u003c/br\u003e\r\n        \u003ca href=\"https://github.com/TheLarkInn\"\u003eSean Larkin\u003c/a\u003e\r\n      \u003c/td\u003e\r\n    \u003c/tr\u003e\r\n  \u003ctbody\u003e\r\n\u003c/table\u003e\r\n\r\n\r\n[npm]: https://img.shields.io/npm/v/script-loader.svg\r\n[npm-url]: https://npmjs.com/package/script-loader\r\n\r\n[node]: https://img.shields.io/node/v/script-loader.svg\r\n[node-url]: https://nodejs.org\r\n\r\n[deps]: https://david-dm.org/webpack/script-loader.svg\r\n[deps-url]: https://david-dm.org/webpack/script-loader\r\n\r\n[chat]: https://badges.gitter.im/webpack/webpack.svg\r\n[chat-url]: https://gitter.im/webpack/webpack\r\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebpack-contrib%2Fscript-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebpack-contrib%2Fscript-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebpack-contrib%2Fscript-loader/lists"}