refactor: [UEPR-17] Changed entry point name

This commit is contained in:
MiroslavDionisiev 2024-06-26 16:42:19 +03:00
parent 67bf9d605a
commit a11ae666f9
2 changed files with 25 additions and 5 deletions

View file

@ -2,12 +2,12 @@
"name": "scratch-svg-renderer", "name": "scratch-svg-renderer",
"version": "2.3.74", "version": "2.3.74",
"description": "SVG renderer for Scratch", "description": "SVG renderer for Scratch",
"main": "./dist/node/ScratchSVGRenderer.js", "main": "./dist/node/scratch-svg-renderer.js",
"browser": "./dist/web/ScratchSVGRenderer.js", "browser": "./dist/web/scratch-svg-renderer.js",
"exports": { "exports": {
"webpack": "./src/index.js", "webpack": "./src/index.js",
"browser": "./dist/web/ScratchSVGRenderer.js", "browser": "./dist/web/scratch-svg-renderer.js",
"node": "./dist/node/ScratchSVGRenderer.js", "node": "./dist/node/scratch-svg-renderer.js",
"default": "./src/index.js" "default": "./src/index.js"
}, },
"scripts": { "scripts": {

View file

@ -3,7 +3,7 @@ const path = require('path');
const ScratchWebpackConfigBuilder = require('scratch-webpack-configuration'); const ScratchWebpackConfigBuilder = require('scratch-webpack-configuration');
const common = { const common = {
libraryName: 'ScratchSVGRenderer', libraryName: 'scratch-svg-renderer',
rootPath: path.resolve(__dirname) rootPath: path.resolve(__dirname)
}; };
@ -12,6 +12,14 @@ const common = {
*/ */
const nodeConfig = new ScratchWebpackConfigBuilder(common) const nodeConfig = new ScratchWebpackConfigBuilder(common)
.setTarget('node') .setTarget('node')
.merge({
output: {
library: {
name: 'ScratchSVGRenderer',
type: 'umd'
}
}
})
.get(); .get();
/** /**
@ -19,6 +27,14 @@ const nodeConfig = new ScratchWebpackConfigBuilder(common)
*/ */
const webConfig = new ScratchWebpackConfigBuilder(common) const webConfig = new ScratchWebpackConfigBuilder(common)
.setTarget('browserslist') .setTarget('browserslist')
.merge({
output: {
library: {
name: 'ScratchSVGRenderer',
type: 'umd'
}
}
})
.get(); .get();
/** /**
@ -33,6 +49,10 @@ const playgroundConfig = new ScratchWebpackConfigBuilder(common)
}, },
output: { output: {
path: path.resolve(__dirname, 'playground'), path: path.resolve(__dirname, 'playground'),
library: {
name: 'ScratchSVGRenderer',
type: 'umd'
},
publicPath: '/' publicPath: '/'
} }
}) })