mirror of
https://github.com/scratchfoundation/scratch-desktop.git
synced 2024-12-22 21:52:31 -05:00
34db5ceaac
This means the module will be found whether linked (as with `npm link`) or not.
38 lines
1.4 KiB
JavaScript
38 lines
1.4 KiB
JavaScript
const path = require('path');
|
|
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
|
|
const makeConfig = require('./webpack.makeConfig.js');
|
|
|
|
const getModulePath = moduleName => path.dirname(require.resolve(`${moduleName}/package.json`));
|
|
|
|
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: path.join(getModulePath('scratch-blocks'), 'media'),
|
|
to: 'static/blocks-media'
|
|
}]),
|
|
new CopyWebpackPlugin([{
|
|
from: 'extension-worker.{js,js.map}',
|
|
context: path.join(getModulePath('scratch-vm'), 'dist', 'web')
|
|
}]),
|
|
new CopyWebpackPlugin([{
|
|
from: path.join(getModulePath('scratch-gui'), 'src', 'lib', 'libraries', '*.json'),
|
|
to: 'static/libraries',
|
|
flatten: true
|
|
}])
|
|
]
|
|
}
|
|
);
|