{"id":26273378,"url":"https://github.com/gfrancischelli/servicenow-uploader-webpack-plugin","last_synced_at":"2025-07-24T21:35:50.658Z","repository":{"id":57155544,"uuid":"95114145","full_name":"gfrancischelli/servicenow-uploader-webpack-plugin","owner":"gfrancischelli","description":null,"archived":false,"fork":false,"pushed_at":"2019-03-17T00:01:13.000Z","size":5,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-26T13:21:18.708Z","etag":null,"topics":["plugin","servicenow","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/gfrancischelli.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}},"created_at":"2017-06-22T12:39:03.000Z","updated_at":"2024-01-22T14:57:04.000Z","dependencies_parsed_at":"2022-08-26T08:31:13.569Z","dependency_job_id":null,"html_url":"https://github.com/gfrancischelli/servicenow-uploader-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfrancischelli%2Fservicenow-uploader-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfrancischelli%2Fservicenow-uploader-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfrancischelli%2Fservicenow-uploader-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfrancischelli%2Fservicenow-uploader-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gfrancischelli","download_url":"https://codeload.github.com/gfrancischelli/servicenow-uploader-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252570499,"owners_count":21769666,"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":["plugin","servicenow","webpack"],"created_at":"2025-03-14T08:16:22.512Z","updated_at":"2025-05-05T20:29:02.800Z","avatar_url":"https://github.com/gfrancischelli.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# servicenow-uploader-webpack-plugin\n\nThis plugin uploads the source code to ServiceNow after compilation and before writing to disk.\n\n\u003e **Note:** this plugin assumes the webpack config will produce [*only one chunk*](https://webpack.js.org/guides/code-splitting/). This mean you it will consider only the first entry point and plugins like `SplitChunksPlugin` will not work as expected.\n\n\n\n## Getting Started\n\nInstall `servicenow-uploader-webpack-plugin`\n\n`$ npm i --save-dev servicenow-uploader-webpack-plugin`\n\nor\n\n`$ yarn add -D servicenow-uploader-webpack-plugin`\n\n\n\nCreate a configuration file:\n\n**.sn-config.json**\n\n```json\n{\n  \"sys_id\": \"xxx\",\n  \"table\": \"sys_ui_script\",\n  \"username\": \"admin\",\n  \"password\": \"1234\",\n  \"instance\": \"https://dev9999.service-now.com\"\n}\n```\n\n\u003e **Note:** This configuration file mirrors the constructor signature config schema. Feel free to use what works best for your use case.\n\n\n\nAdd `.sn-config.json` to `.gitignore`. You don't want sensitive information in your repo.\n\n`$ echo \".sn-config.json \u003e\u003e .gitignore`\n\n\n\nAdd to webpack config:\n\n**webpack.config.js**\n\n```javascript\nconst ServiceNowUploader = require(\"servicenow-uploader-webpack-plugin\");\nconst config = require(\"./.sn-config.json\");\n\nmodule.exports = {\n  plugins: [new ServiceNowUploader(config)]\n};\n```\n\n\n\n## Usage\n\nThis plugin works by hooking onto webpack compilation and uploading the transformed source code to ServiceNow. If a `sys_id` is present in the configuration the record will be updated.\n\nIf no `sys_id` is present the record will be inserted instead, but *only* if `name` and `onInput` callback are specified. The motivation behind this is to give you full control of your configuration schema, using the `onInput` callback to update the `sys_id` or any other desired info.\n\n**Basic example**\n\n```javascript\nconst config = { name, table, ...credentials};\n\nconst onInput = ({ sys_id }) =\u003e config.sys_id = sys_id;\n\nnew ServiceNowUploader(config, { onInput });\n```\n\n\n\n### Constructor `new ServiceNowUploader(config, options)`\n\nUploads the transformed source code to instance using credentials specified inside config. The target record is updated if the `sys_id` isn't present. Otherwise the record is inserted and the config is updated instead.\n\n#### `config`\n\nType: `Object`\n\n##### `config.sys_id`\n\nType: `string`\u003cbr\u003e\nOptional\n\nTarget record sys_id.\n\n##### `config.name`\n\nType: `string`\u003cbr\u003e\n\nDefault: webpack entry point file name\n\nTarget record's display name.\n\n##### `config.table`\n\nType: `string`\u003cbr\u003e\nDefault: `sys_ui_script`\n\nTarget table. Uses ui script because it can be imported to other client side tables like ui pages and client scripts.\n\n##### `config.instance`\n\nType: `string`\u003cbr\u003e\n\nYour instance complete URL.\n\n##### `config.username`\n\nType: `string`\u003cbr\u003e\n\nBe sure the user has write access to the target table.\n\n##### `config.password`\n\nType: `string`\n\n\n\n#### `options`\n\nType: `Object`\u003cbr\u003eOptional\n\n##### `log`\n\nType: `Boolean`\nDefault: `true`\n\nEnables logging\n\n##### `onInsert`\n\nType: `Function`\u003cbr\u003e\nOptional\n\nExecute when the record is inserted in ServiceNow. Expectes SN response as argument.\n\n##### `onUpdate`\n\nType: `Function`\u003cbr\u003eOptional\n\nExecute when the record is updated in ServiceNow. Expectes SN response as argument.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfrancischelli%2Fservicenow-uploader-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgfrancischelli%2Fservicenow-uploader-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfrancischelli%2Fservicenow-uploader-webpack-plugin/lists"}