diff --git a/package.json b/package.json index b9038cd..371f59e 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,12 @@ "name": "scratch-svg-renderer", "version": "2.3.74", "description": "SVG renderer for Scratch", - "main": "./dist/node/ScratchSVGRenderer.js", - "browser": "./dist/web/ScratchSVGRenderer.js", + "main": "./dist/node/scratch-svg-renderer.js", + "browser": "./dist/web/scratch-svg-renderer.js", "exports": { "webpack": "./src/index.js", - "browser": "./dist/web/ScratchSVGRenderer.js", - "node": "./dist/node/ScratchSVGRenderer.js", + "browser": "./dist/web/scratch-svg-renderer.js", + "node": "./dist/node/scratch-svg-renderer.js", "default": "./src/index.js" }, "scripts": { diff --git a/webpack.config.js b/webpack.config.js index d8636b6..659c865 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,7 +3,7 @@ const path = require('path'); const ScratchWebpackConfigBuilder = require('scratch-webpack-configuration'); const common = { - libraryName: 'ScratchSVGRenderer', + libraryName: 'scratch-svg-renderer', rootPath: path.resolve(__dirname) }; @@ -12,6 +12,14 @@ const common = { */ const nodeConfig = new ScratchWebpackConfigBuilder(common) .setTarget('node') + .merge({ + output: { + library: { + name: 'ScratchSVGRenderer', + type: 'umd' + } + } + }) .get(); /** @@ -19,6 +27,14 @@ const nodeConfig = new ScratchWebpackConfigBuilder(common) */ const webConfig = new ScratchWebpackConfigBuilder(common) .setTarget('browserslist') + .merge({ + output: { + library: { + name: 'ScratchSVGRenderer', + type: 'umd' + } + } + }) .get(); /** @@ -33,6 +49,10 @@ const playgroundConfig = new ScratchWebpackConfigBuilder(common) }, output: { path: path.resolve(__dirname, 'playground'), + library: { + name: 'ScratchSVGRenderer', + type: 'umd' + }, publicPath: '/' } })