scratch-desktop/webpack.renderer.js
Christopher Willis-Ford cca18b6d67 fix paths for CopyWebpackPlugin
These files are no longer listed as dependencies of scratch-desktop so
we need to reach into scratch-gui to get them. We should find a better
solution but this will work for now.
2020-09-03 16:57:04 -07:00

36 lines
1.3 KiB
JavaScript

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,
disableDefaultRulesForExtensions: ['js', 'jsx', 'css', 'svg', 'png', 'wav', 'gif', 'jpg', 'ttf'],
babelPaths: [
path.resolve(__dirname, 'src', 'renderer'),
/node_modules[\\/]+scratch-[^\\/]+[\\/]+src/,
/node_modules[\\/]+pify/,
/node_modules[\\/]+@vernier[\\/]+godirect/
],
plugins: [
new CopyWebpackPlugin([{
from: 'node_modules/scratch-gui/node_modules/scratch-blocks/media',
to: 'static/blocks-media'
}]),
new CopyWebpackPlugin([{
from: 'extension-worker.{js,js.map}',
context: 'node_modules/scratch-vm/dist/web'
}]),
new CopyWebpackPlugin([{
from: 'node_modules/scratch-gui/src/lib/libraries/*.json',
to: 'static/libraries',
flatten: true
}])
]
}
);