mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-13 19:06:26 +00:00
1dea4e73b6
commit9c6d55cfc7
Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Thu Oct 20 10:35:49 2022 -0700 Small fixes commit23d6c00ccb
Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Thu Oct 20 06:12:42 2022 -0700 Refactor frontend commitb2c21d4a98
Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Wed Oct 19 07:26:00 2022 -0700 Small fixes (more) commit78a8ab799d
Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Wed Oct 19 02:11:03 2022 -0700 Try out to revert depth chart commitef73c980a8
Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Tue Oct 18 11:43:37 2022 -0700 Small fixes commitfa3e60208f
Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Tue Oct 18 09:43:03 2022 -0700 Add old UserGen and BottomBar to new main.tsx commit1e257d1924
Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Tue Oct 18 04:01:53 2022 -0700 Add Maker and Book page to new main.tsx commit037d46ceef
Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Mon Oct 17 08:54:55 2022 -0700 Add Main component WIP commite43b274c33
Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Mon Oct 17 04:32:43 2022 -0700 App as functional component
91 lines
2.0 KiB
TypeScript
91 lines
2.0 KiB
TypeScript
import path from 'path';
|
|
import { Configuration } from 'webpack';
|
|
import CopyPlugin from 'copy-webpack-plugin';
|
|
|
|
const config: Configuration = {
|
|
entry: './src/index.js',
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.(ts|js)x?$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: 'babel-loader',
|
|
options: {
|
|
presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript'],
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: ['.tsx', '.ts', '.jsx', '.js'],
|
|
},
|
|
};
|
|
|
|
const configWeb: Configuration = {
|
|
...config,
|
|
output: {
|
|
path: path.resolve(__dirname, 'static/frontend'),
|
|
filename: 'basic.js',
|
|
},
|
|
};
|
|
|
|
const configMobile: Configuration = {
|
|
...config,
|
|
module: {
|
|
...config.module,
|
|
rules: [
|
|
...(config?.module?.rules || []),
|
|
{
|
|
test: path.resolve(__dirname, 'src/i18n/Web.js'),
|
|
loader: 'file-replace-loader',
|
|
options: {
|
|
condition: 'if-replacement-exists',
|
|
replacement: path.resolve(__dirname, 'src/i18n/Native.js'),
|
|
async: true,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
plugins: [
|
|
new CopyPlugin({
|
|
patterns: [
|
|
{
|
|
from: path.resolve(__dirname, 'static/css'),
|
|
to: path.resolve(__dirname, '../mobile/html/Web.bundle/css'),
|
|
},
|
|
],
|
|
}),
|
|
],
|
|
output: {
|
|
path: path.resolve(__dirname, '../mobile/html/Web.bundle/js'),
|
|
filename: 'main.js',
|
|
},
|
|
};
|
|
|
|
const configWebPro: Configuration = {
|
|
...config,
|
|
module: {
|
|
...config.module,
|
|
rules: [
|
|
...(config?.module?.rules || []),
|
|
{
|
|
test: path.resolve(__dirname, 'src/basic/Main.tsx'),
|
|
loader: 'file-replace-loader',
|
|
options: {
|
|
condition: 'if-replacement-exists',
|
|
replacement: path.resolve(__dirname, 'src/pro/Main.tsx'),
|
|
async: true,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
output: {
|
|
path: path.resolve(__dirname, 'static/frontend'),
|
|
filename: 'pro.js',
|
|
},
|
|
};
|
|
|
|
export default [configWeb, configWebPro, configMobile];
|