1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-26 00:48:35 +00:00
trezor-wallet/webpack/webpack.config.connect.js
2018-03-27 17:12:58 +02:00

37 lines
1.2 KiB
JavaScript

import { TREZOR_CONNECT, TREZOR_IFRAME, TREZOR_POPUP, TREZOR_CONNECT_FILES, TREZOR_CONNECT_HTML } from './constants';
import path from 'path';
import webpack from 'webpack';
import webpackMerge from 'webpack-merge';
import baseConfig from './webpack.config.dev';
import HtmlWebpackPlugin from 'html-webpack-plugin';
module.exports = webpackMerge(baseConfig, {
entry: {
'trezor-connect2': `${TREZOR_CONNECT}.js`,
'iframe': ['babel-polyfill', `${TREZOR_IFRAME}`],
'popup': `${TREZOR_POPUP}`,
},
resolve: {
alias: {
'trezor-connect': `${TREZOR_CONNECT}`,
}
},
plugins: [
new HtmlWebpackPlugin({
chunks: ['iframe'],
filename: `iframe.html`,
template: `${TREZOR_CONNECT_HTML}iframe.html`,
inject: true
}),
new HtmlWebpackPlugin({
chunks: ['popup'],
filename: 'popup.html',
template: `${TREZOR_CONNECT_HTML}popup.html`,
inject: true
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development-connect'),
PRODUCTION: JSON.stringify(false)
})
]
} );