mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 17:45:52 -05:00
Merge pull request #1 from MiroslavDionisiev/UEPR-27
[UEPR-27] Added missing loaders to handle hex files, updated the configuration for loading css and added plugin to allow babel to habdle jsx files
This commit is contained in:
commit
055039d098
3 changed files with 118 additions and 74 deletions
144
package-lock.json
generated
144
package-lock.json
generated
|
@ -61,6 +61,7 @@
|
|||
"eslint-plugin-react": "7.34.3",
|
||||
"eslint-plugin-react-hooks": "4.6.2",
|
||||
"fastly": "1.2.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"formik": "1.5.8",
|
||||
"formsy-react": "1.1.6",
|
||||
"formsy-react-components": "1.1.0",
|
||||
|
@ -85,7 +86,9 @@
|
|||
"pako": "0.2.8",
|
||||
"plotly.js": "1.47.4",
|
||||
"postcss": "8.4.39",
|
||||
"postcss-import": "^12.0.0",
|
||||
"postcss-loader": "4.3.0",
|
||||
"postcss-simple-vars": "^5.0.1",
|
||||
"prop-types": "15.8.1",
|
||||
"query-string": "5.1.1",
|
||||
"react": "16.14.0",
|
||||
|
@ -110,7 +113,7 @@
|
|||
"selenium-webdriver": "4.22.0",
|
||||
"slick-carousel": "1.8.1",
|
||||
"stream-browserify": "3.0.0",
|
||||
"style-loader": "0.12.3",
|
||||
"style-loader": "^0.23.0",
|
||||
"tap": "14.11.0",
|
||||
"url-loader": "3.0.0",
|
||||
"use-onclickoutside": "0.4.1",
|
||||
|
@ -10606,6 +10609,44 @@
|
|||
"node": "^10.12.0 || >=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/file-loader": {
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz",
|
||||
"integrity": "sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"loader-utils": "^2.0.0",
|
||||
"schema-utils": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.13.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/webpack"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"webpack": "^4.0.0 || ^5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/file-loader/node_modules/schema-utils": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz",
|
||||
"integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/json-schema": "^7.0.8",
|
||||
"ajv": "^6.12.5",
|
||||
"ajv-keywords": "^3.5.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.13.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/webpack"
|
||||
}
|
||||
},
|
||||
"node_modules/fill-range": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||
|
@ -23105,35 +23146,6 @@
|
|||
"react": "^16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/scratch-gui/node_modules/style-loader": {
|
||||
"version": "0.23.1",
|
||||
"resolved": "https://registry.npmjs.org/style-loader/-/style-loader-0.23.1.tgz",
|
||||
"integrity": "sha512-XK+uv9kWwhZMZ1y7mysB+zoihsEj4wneFWAS5qoiLwzW0WzSqMrrsIy+a3zkQJq0ipFtBpX5W3MqyRIBF/WFGg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"loader-utils": "^1.1.0",
|
||||
"schema-utils": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/scratch-gui/node_modules/style-loader/node_modules/schema-utils": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz",
|
||||
"integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ajv": "^6.1.0",
|
||||
"ajv-errors": "^1.0.0",
|
||||
"ajv-keywords": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
}
|
||||
},
|
||||
"node_modules/scratch-l10n": {
|
||||
"version": "3.18.209",
|
||||
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.18.209.tgz",
|
||||
|
@ -24926,56 +24938,56 @@
|
|||
"license": "MIT"
|
||||
},
|
||||
"node_modules/style-loader": {
|
||||
"version": "0.12.3",
|
||||
"resolved": "https://registry.npmjs.org/style-loader/-/style-loader-0.12.3.tgz",
|
||||
"integrity": "sha512-tMrC7GUZ7ryJXwyO92eg8mUWZpOK5v5ptL4zXz97Qrxxbz+kKTJNmGx5IUTFpzWxbmP5Ro1HYV4lJp9Rcn0yvA==",
|
||||
"version": "0.23.1",
|
||||
"resolved": "https://registry.npmjs.org/style-loader/-/style-loader-0.23.1.tgz",
|
||||
"integrity": "sha512-XK+uv9kWwhZMZ1y7mysB+zoihsEj4wneFWAS5qoiLwzW0WzSqMrrsIy+a3zkQJq0ipFtBpX5W3MqyRIBF/WFGg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"loader-utils": "^0.2.5"
|
||||
}
|
||||
},
|
||||
"node_modules/style-loader/node_modules/big.js": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz",
|
||||
"integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"loader-utils": "^1.1.0",
|
||||
"schema-utils": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/style-loader/node_modules/emojis-list": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz",
|
||||
"integrity": "sha512-knHEZMgs8BB+MInokmNTg/OyPlAddghe1YBgNwJBc5zsJi/uyIcXoSDsL/W9ymOsBoBGdPIHXYJ9+qKFwRwDng==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
"node": ">= 0.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/style-loader/node_modules/json5": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
|
||||
"integrity": "sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
|
||||
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.0"
|
||||
},
|
||||
"bin": {
|
||||
"json5": "lib/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/style-loader/node_modules/loader-utils": {
|
||||
"version": "0.2.17",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz",
|
||||
"integrity": "sha512-tiv66G0SmiOx+pLWMtGEkfSEejxvb6N6uRrQjfWJIT79W9GMpgKeCAmm9aVBKtd4WEgntciI8CsGqjpDoCWJug==",
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz",
|
||||
"integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"big.js": "^3.1.3",
|
||||
"emojis-list": "^2.0.0",
|
||||
"json5": "^0.5.0",
|
||||
"object-assign": "^4.0.1"
|
||||
"big.js": "^5.2.2",
|
||||
"emojis-list": "^3.0.0",
|
||||
"json5": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/style-loader/node_modules/schema-utils": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz",
|
||||
"integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ajv": "^6.1.0",
|
||||
"ajv-errors": "^1.0.0",
|
||||
"ajv-keywords": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
}
|
||||
},
|
||||
"node_modules/stylis": {
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
"eslint-plugin-react": "7.34.3",
|
||||
"eslint-plugin-react-hooks": "4.6.2",
|
||||
"fastly": "1.2.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"formik": "1.5.8",
|
||||
"formsy-react": "1.1.6",
|
||||
"formsy-react-components": "1.1.0",
|
||||
|
@ -119,8 +120,10 @@
|
|||
"minilog": "2.1.0",
|
||||
"pako": "0.2.8",
|
||||
"plotly.js": "1.47.4",
|
||||
"postcss-import": "^12.0.0",
|
||||
"postcss": "8.4.39",
|
||||
"postcss-loader": "4.3.0",
|
||||
"postcss-simple-vars": "^5.0.1",
|
||||
"prop-types": "15.8.1",
|
||||
"query-string": "5.1.1",
|
||||
"react": "16.14.0",
|
||||
|
@ -145,7 +148,7 @@
|
|||
"selenium-webdriver": "4.22.0",
|
||||
"slick-carousel": "1.8.1",
|
||||
"stream-browserify": "3.0.0",
|
||||
"style-loader": "0.12.3",
|
||||
"style-loader": "^0.23.0",
|
||||
"tap": "14.11.0",
|
||||
"url-loader": "3.0.0",
|
||||
"use-onclickoutside": "0.4.1",
|
||||
|
|
|
@ -123,7 +123,20 @@ module.exports = {
|
|||
/node_modules[\\/]scratch-[^\\/]+[\\/]src/,
|
||||
/node_modules[\\/]pify/,
|
||||
/node_modules[\\/]async/
|
||||
]
|
||||
],
|
||||
options: {
|
||||
presets: ['@babel/preset-env', '@babel/preset-react']
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.hex$/,
|
||||
type: 'asset/resource',
|
||||
use: [{
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 16 * 1024
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
test: /\.scss$/,
|
||||
|
@ -151,20 +164,29 @@ module.exports = {
|
|||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
MiniCssExtractPlugin.loader,
|
||||
{
|
||||
loader: 'style-loader'
|
||||
},
|
||||
{
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
url: false
|
||||
modules: {
|
||||
localIdentName: '[name]_[local]_[hash:base64:5]',
|
||||
exportLocalsConvention: 'camelCase'
|
||||
},
|
||||
importLoaders: 1,
|
||||
esModule: false
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
postcssOptions: {
|
||||
plugins: function () {
|
||||
return [autoprefixer()];
|
||||
}
|
||||
plugins: [
|
||||
'postcss-import',
|
||||
'postcss-simple-vars',
|
||||
'autoprefixer'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -200,6 +222,9 @@ module.exports = {
|
|||
new EmitFilePlugin({
|
||||
filename: 'version.txt',
|
||||
content: getVersionId
|
||||
}),
|
||||
new webpack.ProvidePlugin({
|
||||
Buffer: ['buffer', 'Buffer']
|
||||
})
|
||||
].concat(pageRoutes
|
||||
.map(route => new HtmlWebpackPlugin(defaults({}, {
|
||||
|
@ -250,7 +275,11 @@ module.exports = {
|
|||
'process.env.STATIC_HOST': `"${process.env.STATIC_HOST || 'https://uploads.scratch.mit.edu'}"`,
|
||||
'process.env.SCRATCH_ENV': `"${process.env.SCRATCH_ENV || 'development'}"`,
|
||||
'process.env.THUMBNAIL_URI': `"${process.env.THUMBNAIL_URI || '/internalapi/project/thumbnail/{}/set/'}"`,
|
||||
'process.env.THUMBNAIL_HOST': `"${process.env.THUMBNAIL_HOST || ''}"`
|
||||
'process.env.THUMBNAIL_HOST': `"${process.env.THUMBNAIL_HOST || ''}"`,
|
||||
'process.env.DEBUG': Boolean(process.env.DEBUG),
|
||||
'process.env.GA_ID': `"${process.env.GA_ID || 'UA-000000-01'}"`,
|
||||
'process.env.GTM_ENV_AUTH': `"${process.env.GTM_ENV_AUTH || ''}"`,
|
||||
'process.env.GTM_ID': process.env.GTM_ID ? `"${process.env.GTM_ID}"` : null
|
||||
})
|
||||
])
|
||||
.concat(process.env.ANALYZE_BUNDLE === 'true' ? [
|
||||
|
|
Loading…
Reference in a new issue