Skip to content

Commit f1438f7

Browse files
committed
build!: use scratch-webpack-configuration
BREAKING CHANGE: changes layout of output files and browser compatibility
1 parent d963343 commit f1438f7

File tree

9 files changed

+210
-367
lines changed

9 files changed

+210
-367
lines changed

.babelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"messagesDir": "./translations/messages/"
88
}]],
99
"presets": [
10-
["@babel/preset-env", {"targets": {"browsers": ["last 3 versions", "Safari >= 8", "iOS >= 8"]}}],
10+
"@babel/preset-env",
1111
"@babel/preset-react"
1212
]
1313
}

.browserslistrc

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
last 3 versions
2-
Safari >= 8
3-
iOS >= 8
1+
# See https://scratch.mit.edu/faq
2+
Chrome >= 63
3+
Edge >= 15
4+
Firefox >= 57
5+
Safari >= 11
6+
Android >= 63
7+
iOS >= 11

.eslintignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
node_modules/*
2-
build/*
32
dist/*
43
test/*
54
src/examples/*

package-lock.json

+25-121
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
},
1212
"main": "./dist/scratch-gui.js",
1313
"scripts": {
14-
"build": "npm run clean && webpack",
15-
"clean": "rimraf ./build && mkdirp build && rimraf ./dist && mkdirp dist",
16-
"deploy": "touch build/.nojekyll && gh-pages -t -d build -m \"[skip ci] Build for $(git log --pretty=format:%H -n1)\"",
14+
"build": "npm run clean && mkdirp dist && webpack",
15+
"clean": "rimraf ./dist",
16+
"deploy": "touch build/.nojekyll && gh-pages -t -d dist -m \"[skip ci] Build for $(git log --pretty=format:%H -n1)\"",
1717
"prepublish": "node scripts/prepublish.mjs",
1818
"prune": "./prune-gh-pages.sh",
1919
"i18n:push": "tx-push-src scratch-editor interface translations/en.json",
@@ -136,9 +136,9 @@
136136
"redux-mock-store": "1.5.4",
137137
"rimraf": "2.7.1",
138138
"scratch-semantic-release-config": "1.0.14",
139+
"scratch-webpack-configuration": "1.1.0",
139140
"selenium-webdriver": "3.6.0",
140141
"semantic-release": "19.0.5",
141-
"terser-webpack-plugin": "4.2.3",
142142
"url-loader": "4.1.1",
143143
"web-audio-test-api": "0.5.2",
144144
"webpack": "5.90.3",
@@ -158,6 +158,9 @@
158158
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/test/__mocks__/fileMock.js",
159159
"\\.(css|less)$": "<rootDir>/test/__mocks__/styleMock.js",
160160
"editor-msgs(\\.js)?$": "<rootDir>/test/__mocks__/editor-msgs-mock.js"
161+
},
162+
"transform": {
163+
"^.+\\.[cm]?jsx?$": "babel-jest"
161164
}
162165
}
163166
}

src/lib/backpack/sound-payload.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// eslint-disable-next-line import/no-unresolved
2-
import soundThumbnail from '!base64-loader!./sound-thumbnail.jpg';
2+
import soundThumbnail from '!base64-loader!./sound-thumbnail.jpg?';
33

44
const soundPayload = sound => {
55
const assetDataUrl = sound.asset.encodeDataURI();

src/lib/default-project/index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import projectData from './project-data';
22

33
/* eslint-disable import/no-unresolved */
4-
import popWav from '!arraybuffer-loader!./83a9787d4cb6f3b7632b4ddfebf74367.wav';
5-
import meowWav from '!arraybuffer-loader!./83c36d806dc92327b9e7049a565c6bff.wav';
6-
import backdrop from '!raw-loader!./cd21514d0531fdffb22204e0ec5ed84a.svg';
7-
import costume1 from '!raw-loader!./bcf454acf82e4504149f7ffe07081dbc.svg';
8-
import costume2 from '!raw-loader!./0fb9be3e8397c983338cb71dc84d0b25.svg';
4+
import popWav from '!arraybuffer-loader!./83a9787d4cb6f3b7632b4ddfebf74367.wav?';
5+
import meowWav from '!arraybuffer-loader!./83c36d806dc92327b9e7049a565c6bff.wav?';
6+
import backdrop from '!raw-loader!./cd21514d0531fdffb22204e0ec5ed84a.svg?';
7+
import costume1 from '!raw-loader!./bcf454acf82e4504149f7ffe07081dbc.svg?';
8+
import costume2 from '!raw-loader!./0fb9be3e8397c983338cb71dc84d0b25.svg?';
99
/* eslint-enable import/no-unresolved */
1010

1111
const defaultProject = translator => {

src/lib/define-dynamic-block.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// TODO: access `BlockType` and `ArgumentType` without reaching into VM
22
// Should we move these into a new extension support module or something?
3-
import ArgumentType from 'scratch-vm/src/extension-support/argument-type';
4-
import BlockType from 'scratch-vm/src/extension-support/block-type';
3+
import {ArgumentType, BlockType} from 'scratch-vm';
54

65
/**
76
* Define a block using extension info which has the ability to dynamically determine (and update) its layout.

0 commit comments

Comments
 (0)