From e0f937d33e754dbd0f186541961a17b051fecdab Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Tue, 1 Sep 2020 11:02:03 -0700 Subject: [PATCH] Add a script for copy-workers (#5338) --- site/package.json | 2 +- site/scripts/copy-workers.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 site/scripts/copy-workers.js diff --git a/site/package.json b/site/package.json index c416fe5bf1..1aaef9b096 100644 --- a/site/package.json +++ b/site/package.json @@ -4,7 +4,7 @@ "description": "Docs and examples for Svelte", "scripts": { "dev": "npm run copy-workers && sapper dev", - "copy-workers": "rm -rf static/workers && cp -r node_modules/@sveltejs/svelte-repl/workers static", + "copy-workers": "node scripts/copy-workers.js", "migrate": "node-pg-migrate -r dotenv/config", "sapper": "npm run copy-workers && sapper build --legacy", "update": "node scripts/update_template.js && node scripts/get-contributors.js && node scripts/update_whos_using.js", diff --git a/site/scripts/copy-workers.js b/site/scripts/copy-workers.js new file mode 100644 index 0000000000..4856764ad0 --- /dev/null +++ b/site/scripts/copy-workers.js @@ -0,0 +1,4 @@ +const sh = require('shelljs'); + +sh.rm('-rf', 'static/workers'); +sh.cp('-r', 'node_modules/@sveltejs/svelte-repl/workers', 'static');