2018-03-27 15:12:58 +00:00
|
|
|
import { TREZOR_CONNECT, TREZOR_IFRAME, TREZOR_POPUP, TREZOR_CONNECT_FILES, TREZOR_CONNECT_HTML } from './constants';
|
2017-12-13 11:01:37 +00:00
|
|
|
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`,
|
2018-03-27 15:12:58 +00:00
|
|
|
'iframe': ['babel-polyfill', `${TREZOR_IFRAME}`],
|
2017-12-13 11:01:37 +00:00
|
|
|
'popup': `${TREZOR_POPUP}`,
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'trezor-connect': `${TREZOR_CONNECT}`,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
chunks: ['iframe'],
|
|
|
|
filename: `iframe.html`,
|
2018-03-27 15:12:58 +00:00
|
|
|
template: `${TREZOR_CONNECT_HTML}iframe.html`,
|
2017-12-13 11:01:37 +00:00
|
|
|
inject: true
|
|
|
|
}),
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
chunks: ['popup'],
|
|
|
|
filename: 'popup.html',
|
2018-03-27 15:12:58 +00:00
|
|
|
template: `${TREZOR_CONNECT_HTML}popup.html`,
|
2017-12-13 11:01:37 +00:00
|
|
|
inject: true
|
|
|
|
}),
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env.NODE_ENV': JSON.stringify('development-connect'),
|
|
|
|
PRODUCTION: JSON.stringify(false)
|
|
|
|
})
|
|
|
|
]
|
|
|
|
} );
|