{"id":42807209,"url":"https://github.com/liuyuchenzh/webpack-upload-plugin","last_synced_at":"2026-01-30T04:13:03.890Z","repository":{"id":22459800,"uuid":"96309647","full_name":"liuyuchenzh/webpack-upload-plugin","owner":"liuyuchenzh","description":"A plugin for webpack","archived":false,"fork":false,"pushed_at":"2026-01-23T17:02:18.000Z","size":851,"stargazers_count":20,"open_issues_count":30,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-24T07:39:39.194Z","etag":null,"topics":["webpack","wepack-upload-plugin"],"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/liuyuchenzh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-07-05T10:57:21.000Z","updated_at":"2025-06-03T11:21:05.000Z","dependencies_parsed_at":"2026-01-23T19:04:18.676Z","dependency_job_id":null,"html_url":"https://github.com/liuyuchenzh/webpack-upload-plugin","commit_stats":{"total_commits":212,"total_committers":7,"mean_commits":"30.285714285714285","dds":"0.28301886792452835","last_synced_commit":"89e47cbbe789b239948189c7b5dc56c5984b87a4"},"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"purl":"pkg:github/liuyuchenzh/webpack-upload-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuyuchenzh%2Fwebpack-upload-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuyuchenzh%2Fwebpack-upload-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuyuchenzh%2Fwebpack-upload-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuyuchenzh%2Fwebpack-upload-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liuyuchenzh","download_url":"https://codeload.github.com/liuyuchenzh/webpack-upload-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuyuchenzh%2Fwebpack-upload-plugin/sbom","scorecard":{"id":385044,"data":{"date":"2025-08-11","repo":{"name":"github.com/liuyuchenzh/webpack-upload-plugin","commit":"c51d263437e23ca70a2780f7da596ec7676e3ca7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":4,"reason":"Found 4/9 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"44 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx","Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T16:23:48.842Z","repository_id":22459800,"created_at":"2025-08-18T16:23:48.842Z","updated_at":"2025-08-18T16:23:48.842Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28900993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T04:02:34.702Z","status":"ssl_error","status_checked_at":"2026-01-30T04:02:33.562Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","wepack-upload-plugin"],"created_at":"2026-01-30T04:13:03.234Z","updated_at":"2026-01-30T04:13:03.883Z","avatar_url":"https://github.com/liuyuchenzh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webpack-upload-plugin\n\n## Intro\n\nThis is a plugin for [webpack](https://github.com/webpack/webpack).\n\nThe main aim is to provide a tool to upload js/css/img/font used in html (or template in other language) to cdn, and then replace the reference with the corresponding cdn url.\n\n## Environment requirement\n\nnode \u003e= 10.5.0\n\n## Install\n\n```bash\nnpm i -D webpack-upload-plugin\n```\n\n## Notice\n\n- This plugin does not provide a service as uploading to cdn. In fact, it actually depends on such service.\n- This plugin is for webpack \u003e= 3.\n- For webpack@4, set `optimization.minimize` to `false`!\n- This plugin _doesn't_ work well with `UglifyJs` plugin! Use `beforeUpload` if you want to compress anyway.\n- Pay extra attention to your `publicPath` field of `webpack.config.js`, `''` is likely the best choice.\n\n\u003e For webpack@2, please use webpack-upload-plugin \u003c= 0.20.0\n\n## Dependency\n\n`webpack-upload-plugin` relies on the existence a `cdn` object with an `upload` method described as below.\n\n```typescript\ntype cdnUrl = string\ninterface cdnRes {\n  [localPath: string]: cdnUrl\n}\n// this is what cdn package looks like\ninterface cdn {\n  upload: (localPaths: string[]) =\u003e Promise\u003ccdnRes\u003e\n}\n```\n\nHere is a sudo implementation of `cdn` in vanilla javascript.\n\n```js\n/**\n * @param {string[]} localPaths: list of paths of local files\n * @return Promise\u003ccdnRes\u003e: resolved Promise with structure like {localPath: cdnUrl}\n */\nfunction upload(localPaths) {\n  return Promise.all(\n    localPaths.map((localPath) =\u003e {\n      return Promise.resolve({\n        [localPath]: 'cdn_url_for_this_file',\n      })\n    })\n  ).then(\n    (pairs) =\u003e\n      pairs.reduce((last, pair) =\u003e {\n        return Object.assign(last, pair)\n      }, {}),\n    () =\u003e ({})\n  )\n}\nconst cdn = {\n  upload,\n}\n```\n\n## Use case\n\n### Basic one\n\nFor a simple project with such structure:\n\n```txt\n+-- src\n|   +-- assets\n|   |   +-- avatar.png\n|   +-- index.js\n|   +-- index.css\n+-- dist\n+-- index.html\n+-- webpack.config.js\n```\n\n```js\n// in webpack.config.js\nconst path = require('path')\nconst HtmlWebpackPlugin = require('html-webpack-plugin')\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin')\nconst UploadPlugin = require('webpack-upload-plugin')\nconst cdn = require('xxx-cdn')\n\nmodule.exports = {\n  entry: './src/index.js',\n  output: {\n    path: path.resolve(__dirname, 'dist'),\n    filename: 'bundle.js',\n    publicPath: '',\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.js$/,\n        loader: 'babel-loader',\n      },\n      {\n        test: /\\.css$/,\n        use: [MiniCssExtractPlugin.loader, 'css-loader'],\n      },\n      {\n        test: /\\.(png|jpe?g|gif|svg)(\\?.*)?$/,\n        loader: 'url-loader',\n        options: {\n          limit: 10000,\n        },\n      },\n    ],\n  },\n  optimization: {\n    minimize: false, // important! important! important!\n  },\n  plugins: [\n    new MiniCssExtractPlugin({\n      filename: '[name].css',\n      chunkFilename: '[id].css',\n    }),\n    new HtmlWebpackPlugin({\n      filename: 'index.html',\n      template: 'index.html',\n      inject: true,\n    }),\n    new UploadPlugin(cdn),\n  ],\n}\n```\n\n\u003e For webpack v3 users, use `extract-text-webpack-plugin` instead of `mini-css-extract-plugin`\n\n### Complex one with Server Template\n\nRun webpack in `build`, then copy all emitted files from `build/dist` to `project/src`.\n\nPublic can only access files from `project/public`\n\n```txt\n+-- project\n| +-- src\n| +-- public\n+-- build\n| +-- src\n| | +-- assets\n| | |   +-- avatar.png\n| | +-- index.js\n| | +-- index.css\n| +-- dist\n| +-- index.html\n| +-- webpack.config.js\n```\n\n```js\n// only focus on WebpackUploadPlugin here\n{\n  plugins: [\n    new UploadPlugin(cdn, {\n      src: path.resolve(__dirname, '..', 'project/src'),\n      dist: path.resolve(__dirname, '..', 'project/public'),\n      staticDir: path.resolve(__dirname, '..', 'project/src'),\n      dirtyCheck: true,\n    }),\n  ]\n}\n```\n\n\u003e Make sure `WebpackUploadPlugin` is after any copy-related plugins in `plugins` field.\n\n\u003e If in `project/public`, there are different prefix from `publicPath` you passed to webpack, then use `replaceFn` to remove such prefix.\n\n```js\nconst config = {\n  replaceFn(content, location) {\n    return path.extname(location) === '.html'\n      ? content.replace(prefix, '')\n      : content\n  },\n}\n```\n\n\u003e If the copy process takes a long time, use `waitFor` to make sure only start uploading when things are settled.\n\n## Configuration\n\nIn webpack.config.js\n\n```js\nconst WebpackUploadPlugin = require('webpack-upload-plugin')\nconst cdn = require('some-cdn-package')\nmodule.exports = {\n  plugins: [new WebpackUploadPlugin(cdn, option)],\n}\n```\n\n`option` is optional.\n\nValid fields for `option` are showed below:\n\n### [`smartAssMode`=false]: boolean\n\nIf switch on, we assume that all files needed is in the `output.path` of your webpack config file. No more `src`, `dist`, `staticDir` are needed (and will be ignored if being set).\n\n\u003e This is an _opinionated_ setup. Under the hood, `src`, `dist` and `staticDir` are equivalently set to the same as `output.path`\n\n\u003e The reason for this field is that very likely, files that need to be uploaded are not all generated by webpack bundling but something like copying. In such cases, those copied files cannot be detected through the webpack config, and hence won't be uploaded automatically. With this feature, your life would be easier.\n\n### [`src`]: string\n\n\u003e try `smartAssMode` first\n\nWhere your valid raw template files would appear (with reference to local js/css files). Default to be where html files would be emitted to based on your webpack configuration.\n\nFor templates not dynamically emitted by webpack, eg, files like `php`, `tpl`, `phtml` and so on that are managed by some server logic not client one, this field could be used.\n\n\u003e Use _absolute_ path\n\n### [`dist`]: string\n\n\u003e try `smartAssMode` first\n\nWhere to emit final template files. Only use this when there is a need to separate origin outputs with cdn ones. Default to be same as `src`.\n\nThink in this way:\n\ntemplate from src -\u003e template with cdn reference -\u003e template to dist\n\nUse `dist` only if the third step is needed.\n\n\u003e Use _absolute_ path\n\n### [`urlCb`]: (cdnUrl: string, localPath: string) =\u003e string\n\nAdjust cdn url accordingly. Cdn url would be passed in, and you need to return a string.\n\n```js\nconst url = 'http://domain.com/cdn/bundle.js'\nconst urlCb = (input) =\u003e input.replace(/^https?/, 'https')\n```\n\n### [`resolve`]: string[]\n\nType of templates needed to match. In case you have a project with php, smarty, or other template language instead of html. Default to `['html']`\n\nAgain, for projects using server language template, like `php`, you could set `resolve` to `['php', 'phtml']`\n\n### [`staticDir`]: string | string[]\n\n\u003e try `smartAssMode` first\n\nIf static files (js/css/images etc) emitted by webpack is not what you want, or not enough(normally happens when you need to copy all resources emitted by webpack to another directory), then set `staticDir` to the directory that contains all your desired resource files (js/css/images etc).\n\n\u003e Use _absolute_ path\n\n### [`beforeUpload`]: (fileContent: string, fileLocation: string) =\u003e Promise\u003cstring\u003e | string\n\n_Compression_ can be done here. Two arguments are `fileContent` and `fileLocation` (with extension name of course). You need to return the compression result as string.\n\n```js\n// if you want to compress js before upload\nconst UglifyJs = require('uglify-js')\nconst path = require('path')\nconst beforeUpload = (content, location) =\u003e {\n  if (path.extname(location) === '.js') {\n    return UglifyJs.minify(content).code\n  }\n  return content\n}\n```\n\n### [`replaceFn`]: (fileContent: string, location: string) =\u003e string\n\nFor some complex (ancient) projects, you may have multiple `publicPath` or corresponding concepts. To handle such cases accordingly, you can pass a `replaceFn` function, which will receive two parameters, which are `fileContent` and `location` in that order. `fileContent` would be file in string format with local resources reference. `location` is the location of `fileContent` on your file system. This function will be called when plugin start to replace local reference. The string `replaceFn` returns will represent the desired `publicPath`, which will be used as the input template to replace all local reference with cdn ones.\n\n```js\n// in your latest webpack.config.js\nmodule.exports = {\n  output {\n    publicPath: 'public/static'\n  }\n}\n```\n\n```html\n\u003c!-- in an ancient template file --\u003e\n\u003c!-- bundle.js is actually emitted by webpack --\u003e\n\u003c!-- but some copy action involved in later sometime --\u003e\n\u003c!-- public/static/bundle.js -\u003e public/js/bundle.js --\u003e\n\u003c!-- but this src attribute cannot be changed due to some weird reason --\u003e\n\u003cscript src=\"public/js/bundle.js\"\u003e\u003c/script\u003e\n```\n\nIn such case, `staticDir` could be useful. Or you can use `replaceFn` as followed:\n\n```js\nconst replaceFn = (content, location) =\u003e {\n  const oldPublicReg = /src=\"public\\/js/\n  if (oldPublicReg.test(content)) {\n    return content.replace(oldPublicReg, `src=\"public/static\"`)\n  }\n}\n```\n\nIn this way, `public/static/bundle.js` will be uploaded before it get moved to `public/js`, and the reference replacement stay accurate.\n\n### [`waitFor`]: () =\u003e Promise\u003c\\*\u003e\n\nA function that returns a Promise. The plugin will wait for the Promise to resolve and then start everything.\n\n```js\n// things won't start till 1000ms later\nconst waitFor = new Promise((resolve) =\u003e {\n  setTimeout(resolve, 1000)\n})\n```\n\n### [`dirtyCheck=false`]: boolean\n\nFor cases where chunk file can also be entry file, set `dirtyCheck` to `true` to make sure entry file would be updated properly.\n\n### [`onFinish`]: () =\u003e any\n\nCalled when everything finished. You can further play with files here.\n\n```js\nconst onFinish = () =\u003e {\n  console.log('just want to print this')\n}\n```\n\n### [`onError`]: (e: Error) =\u003e any\n\nCalled when encounter any error.\n\n### [`logLocalFiles=false`]: boolean\n\nWhether to print all uploading file names during the process\n\n### [`passToCdn`]: object\n\nExtra config to pass to `cdn.upload` method. Something Like `cdn.upload(location, passToCdn)`.\n\n```js\n// if your original cdn package has API like this\nconst cdn = require('some-cdn-package')\nconst passToCdn = {\n  https: true,\n}\ncdn.upload(files, passToCdn)\n```\n\n### [`enableCache=true`]: boolean\n\nEnable cache to speed up. Default to `false`.\n\n### [`cacheLocation`]: string\n\nDirectory to emit the upload cache file. Use this when you want to manage the cache file by any VCS.\n\n```js\nconst path = require('path')\nconst cacheLocation = path.resolve(__dirname, 'cacheDirectory')\n```\n\n### [`sliceLimit`]: number\n\nUploading files is not done by once. By using `sliceLimit`, you can limit the number of files being uploaded at once.\n\n### [`forceCopyTemplate=true`]: boolean\n\nForce to copy generated templates from `src` to `dist` even if no cdn Url has been matched. Default to `true`.\n\n\u003e When set to `false`, the generated templates will still be copied from `src` to `dist` as long as if no corresponding file exists in `dist`.\n\n### [`asyncCSS`=true]: boolean\n\nTry to handle async CSS files emitted by `mini-css-extract-plugin`.\n\n### [`compilerHooks`=\"done\"]: string\n\nConfigure when to run the plugin. See [here](https://webpack.js.org/api/compiler-hooks/#hooks)\n\nViola! That's all : )\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2017-present, Yuchen Liu\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliuyuchenzh%2Fwebpack-upload-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliuyuchenzh%2Fwebpack-upload-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliuyuchenzh%2Fwebpack-upload-plugin/lists"}