Files
trezor-suite/packages/connect-web/webpack/inline.webpack.config.ts
Szymon Lesisz 09bf468eed feat(connect-web): add @trezor/connect-web package
chore(connect-web): move webextension

chore(connect-web): move webusb
2022-05-11 16:46:22 +02:00

45 lines
1.2 KiB
TypeScript

import webpack from 'webpack';
import path from 'path';
import TerserPlugin from 'terser-webpack-plugin';
import prod from './prod.webpack.config';
// Generate inline script hosted on https://connect.trezor.io/X/trezor-connect.js
// This is compiled and polyfilled npm package without Core logic
const config: webpack.Configuration = {
target: 'web',
mode: 'production',
entry: {
'trezor-connect': path.resolve(__dirname, '../src/index.ts'),
'trezor-connect.min': path.resolve(__dirname, '../src/index.ts'),
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, '../build'),
publicPath: './',
library: 'TrezorConnect',
libraryTarget: 'umd',
libraryExport: 'default',
},
module: prod.module,
resolve: prod.resolve,
performance: prod.performance,
optimization: {
minimizer: [
new TerserPlugin({
exclude: /trezor-connect.js/,
extractComments: false,
terserOptions: {
format: {
comments: false,
},
},
}),
],
},
};
export default config;