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 }]) ] } );