2020-08-11 19:22:13 -04:00
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
|
|
|
|
|
|
const makeConfig = require('./webpack.makeConfig.js');
|
|
|
|
|
|
|
|
module.exports = defaultConfig =>
|
|
|
|
makeConfig(
|
|
|
|
defaultConfig,
|
|
|
|
{
|
|
|
|
name: 'renderer',
|
|
|
|
useReact: true,
|
2020-08-11 19:21:14 -04:00
|
|
|
disableDefaultRulesForExtensions: ['js', 'jsx', 'css', 'svg', 'png', 'wav', 'gif', 'jpg', 'ttf'],
|
2020-08-11 19:22:13 -04:00
|
|
|
babelPaths: [
|
2020-08-11 19:21:14 -04:00
|
|
|
path.resolve(__dirname, 'src', 'renderer'),
|
|
|
|
/node_modules[\\/]+scratch-[^\\/]+[\\/]+src/,
|
|
|
|
/node_modules[\\/]+pify/,
|
|
|
|
/node_modules[\\/]+@vernier[\\/]+godirect/
|
2020-08-11 19:22:13 -04:00
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
new CopyWebpackPlugin([{
|
2020-09-03 19:55:44 -04:00
|
|
|
from: 'node_modules/scratch-gui/node_modules/scratch-blocks/media',
|
2020-08-11 19:21:14 -04:00
|
|
|
to: 'static/blocks-media'
|
|
|
|
}]),
|
|
|
|
new CopyWebpackPlugin([{
|
|
|
|
from: 'extension-worker.{js,js.map}',
|
|
|
|
context: 'node_modules/scratch-vm/dist/web'
|
|
|
|
}]),
|
|
|
|
new CopyWebpackPlugin([{
|
2020-09-03 19:55:44 -04:00
|
|
|
from: 'node_modules/scratch-gui/src/lib/libraries/*.json',
|
2020-08-11 19:21:14 -04:00
|
|
|
to: 'static/libraries',
|
|
|
|
flatten: true
|
2020-08-11 19:22:13 -04:00
|
|
|
}])
|
|
|
|
]
|
|
|
|
}
|
|
|
|
);
|