Open
Conversation
There was a problem hiding this comment.
Pull request overview
Upgrades the build/tooling stack to prepare scratch-paint for inclusion in the scratch-editor monorepo, centered around a Webpack 5 migration and Node 24 alignment.
Changes:
- Upgrade to Webpack 5 + related loader/plugin updates and adopt
scratch-webpack-configuration. - Update package entrypoints (
main/exports) and dev-server invocation for the new build. - Bump Node runtime to v24 and upgrade
canvasto a compatible major version.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
webpack.config.js |
Replaces bespoke webpack config with scratch-webpack-configuration builder and updates playground/library builds. |
package.json |
Updates build scripts, dependencies, and introduces exports + new main path. |
.nvmrc |
Pins Node to 24.14.0. |
.babelrc |
Removes explicit object-rest-spread plugin, relying on preset-env. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
22
to
28
| output: { | ||
| path: path.resolve(__dirname, 'playground'), | ||
| filename: '[name].js' | ||
| }, | ||
| plugins: base.plugins.concat([ | ||
| new HtmlWebpackPlugin({ | ||
| template: 'src/playground/index.ejs', | ||
| title: 'Scratch 3.0 Paint Editor Playground' | ||
| }) | ||
| ]) | ||
| }), | ||
| // For use as a library | ||
| defaultsDeep({}, base, { | ||
| externals: { | ||
| 'minilog': 'minilog', | ||
| 'prop-types': 'prop-types', | ||
| 'react': 'react', | ||
| 'react-dom': 'react-dom', | ||
| 'react-intl': 'react-intl', | ||
| 'react-intl-redux': 'react-intl-redux', | ||
| 'react-popover': 'react-popover', | ||
| 'react-redux': 'react-redux', | ||
| 'react-responsive': 'react-responsive', | ||
| 'react-style-proptype': 'react-style-proptype', | ||
| 'react-tooltip': 'react-tooltip', | ||
| 'redux': 'redux' | ||
| library: { | ||
| name: 'scratch-paint', | ||
| type: 'umd2' | ||
| } | ||
| }, |
package.json
Outdated
Comment on lines
+5
to
+11
| "main": "./dist/web/scratch-paint.js", | ||
| "browser": "./src/index.js", | ||
| "exports": { | ||
| "webpack": "./src/index.js", | ||
| "browser": "./dist/web/scratch-paint.js", | ||
| "node": "./dist/web/scratch-paint.js", | ||
| "default": "./src/index.js" |
Contributor
Author
There was a problem hiding this comment.
I think it might be more correct to update the exports browser to ./src/index/js. (for now), since this will preserve current behaviour
package.json
Outdated
| "webpack": "./src/index.js", | ||
| "browser": "./dist/web/scratch-paint.js", | ||
| "node": "./dist/web/scratch-paint.js", | ||
| "default": "./src/index.js" |
kbangelov
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves
https://scratchfoundation.atlassian.net/browse/UEPR-156
https://scratchfoundation.atlassian.net/browse/UEPR-154
https://scratchfoundation.atlassian.net/browse/UEPR-159
Proposed Changes
webpackto v5 as well as other packages where necesasry to support the changescratch-webpack-configurationscratch-webpack-configurationReason for Changes
Prepare scratch-paint for introduction to the scratch-editor monorepo
Test Coverage
All existing tests are passing