2023-01-03 19:55:46 +00:00
|
|
|
// Copyright 2019 Signal Messenger, LLC
|
2020-10-30 20:34:04 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-08-23 21:24:52 +00:00
|
|
|
const webpack = require('webpack');
|
|
|
|
|
2019-12-17 20:25:57 +00:00
|
|
|
module.exports = ({ config }) => {
|
2023-03-20 16:50:31 +00:00
|
|
|
config.entry.unshift('!!style-loader!css-loader!sanitize.css');
|
2019-12-17 20:25:57 +00:00
|
|
|
|
2023-01-12 20:58:53 +00:00
|
|
|
config.cache = {
|
|
|
|
type: 'filesystem',
|
|
|
|
};
|
|
|
|
|
2023-01-03 19:55:46 +00:00
|
|
|
config.module.rules.unshift({
|
|
|
|
test: /\.scss$/,
|
2023-01-12 20:58:53 +00:00
|
|
|
use: [
|
|
|
|
{ loader: 'style-loader' },
|
|
|
|
{ loader: 'css-loader?modules=true&localsConvention=camelCaseOnly' },
|
|
|
|
{ loader: 'sass-loader' },
|
2023-01-03 19:55:46 +00:00
|
|
|
],
|
|
|
|
});
|
2019-12-17 20:25:57 +00:00
|
|
|
|
2023-01-12 20:58:53 +00:00
|
|
|
config.node = { global: true };
|
|
|
|
|
2020-09-28 23:46:31 +00:00
|
|
|
config.externals = {
|
2023-01-12 20:58:53 +00:00
|
|
|
net: 'commonjs net',
|
|
|
|
vm: 'commonjs vm',
|
|
|
|
fs: 'commonjs fs',
|
|
|
|
async_hooks: 'commonjs async_hooks',
|
|
|
|
module: 'commonjs module',
|
|
|
|
stream: 'commonjs stream',
|
|
|
|
tls: 'commonjs tls',
|
|
|
|
dns: 'commonjs dns',
|
|
|
|
http: 'commonjs http',
|
|
|
|
https: 'commonjs https',
|
|
|
|
os: 'commonjs os',
|
|
|
|
constants: 'commonjs constants',
|
|
|
|
zlib: 'commonjs zlib',
|
|
|
|
'@signalapp/libsignal-client': 'commonjs @signalapp/libsignal-client',
|
2023-02-23 18:38:09 +00:00
|
|
|
'@signalapp/libsignal-client/zkgroup':
|
|
|
|
'commonjs @signalapp/libsignal-client/zkgroup',
|
2023-01-12 20:58:53 +00:00
|
|
|
'@signalapp/ringrtc': 'commonjs @signalapp/ringrtc',
|
|
|
|
'@signalapp/better-sqlite3': 'commonjs @signalapp/better-sqlite3',
|
2023-02-23 18:38:09 +00:00
|
|
|
electron: 'commonjs electron',
|
2023-01-12 20:58:53 +00:00
|
|
|
'fs-xattr': 'commonjs fs-xattr',
|
2023-02-23 18:38:09 +00:00
|
|
|
fsevents: 'commonjs fsevents',
|
2023-01-12 20:58:53 +00:00
|
|
|
'mac-screen-capture-permissions': 'commonjs mac-screen-capture-permissions',
|
2023-02-23 18:38:09 +00:00
|
|
|
sass: 'commonjs sass',
|
|
|
|
bufferutil: 'commonjs bufferutil',
|
2023-01-12 20:58:53 +00:00
|
|
|
'utf-8-validate': 'commonjs utf-8-validate',
|
2020-09-28 23:46:31 +00:00
|
|
|
};
|
|
|
|
|
2019-12-17 20:25:57 +00:00
|
|
|
return config;
|
|
|
|
};
|