From d5d6ab9eb828005e7ccd614aa666f2a2420533d6 Mon Sep 17 00:00:00 2001 From: "Michael \"Z\" Goddard" Date: Mon, 30 Apr 2018 13:06:40 -0400 Subject: [PATCH] Depend on script dependencies for downstream webpack Downstream webpack will need any dependencies src/ depends on so it can successfully build. Also if multiple packages being built into a larger script share a common dependency version range, they can share the dependency instead of duplicating it. This will save built file size, execution time, and memory. --- package.json | 10 ++++++---- webpack.config.js | 5 +++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 4a2e287..c68a973 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.1.0", "description": "audio engine for scratch 3.0", "main": "dist.js", + "browser": "./src/index.js", "scripts": { "test": "npm run lint && npm run build", "build": "webpack --bail", @@ -20,8 +21,12 @@ "url": "https://github.com/LLK/scratch-audio/issues" }, "homepage": "https://github.com/LLK/scratch-audio#readme", - "devDependencies": { + "dependencies": { "audio-context": "1.0.1", + "minilog": "^3.0.1", + "startaudiocontext": "1.2.1" + }, + "devDependencies": { "babel-core": "^6.24.1", "babel-eslint": "^7.2.2", "babel-loader": "^6.4.1", @@ -29,9 +34,6 @@ "eslint": "^3.19.0", "eslint-config-scratch": "^3.1.0", "json": "^9.0.6", - "minilog": "^3.0.1", - "soundfont-player": "0.10.5", - "startaudiocontext": "1.2.1", "travis-after-all": "^1.4.4", "webpack": "2.4.0" } diff --git a/webpack.config.js b/webpack.config.js index 1494ecd..c6a5827 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -20,5 +20,10 @@ module.exports = { presets: ['es2015'] } }] + }, + externals: { + 'audio-context': true, + 'minilog': true, + 'startaudiocontext': true } };