/ webpack_config / config.js
config.js
1 'use strict'; 2 const path = require('path'); 3 4 const paths = { 5 root: path.join(__dirname, '../'), 6 src: path.join(__dirname, '../common'), 7 output: path.join(__dirname, '../dist'), 8 assets: path.join(__dirname, '../common/assets'), 9 static: path.join(__dirname, '../static'), 10 electron: path.join(__dirname, '../electron-app'), 11 shared: path.join(__dirname, '../shared'), 12 modules: path.join(__dirname, '../node_modules') 13 }; 14 15 module.exports = { 16 // Configuration 17 port: process.env.HTTPS ? 3443 : 3000, 18 title: 'MyCrypto', 19 // description < 200 characters 20 description: 'MyCrypto is a free, open-source interface for interacting with the blockchain.', 21 url: 'https://mycrypto.com/', 22 type: 'website', 23 // img < 5MB 24 img: path.join(paths.assets, 'images/link-preview.png'), 25 twitter: { 26 creator: '@MyCrypto' 27 }, 28 path: paths, 29 30 // Typescript rule config 31 typescriptRule: { 32 test: /\.(ts|tsx)$/, 33 include: [paths.src, paths.shared, paths.electron], 34 use: [{ loader: 'ts-loader', options: { happyPackMode: true, logLevel: 'info' } }], 35 exclude: ['assets', 'sass', 'vendor', 'translations/lang'] 36 .map(dir => path.resolve(paths.src, dir)) 37 .concat([paths.modules]) 38 }, 39 40 // File resolution 41 resolve: { 42 extensions: ['.ts', '.tsx', '.js', '.css', '.json', '.scss'], 43 modules: [paths.src, paths.modules, paths.root] 44 }, 45 46 // Vendor modules 47 vendorModules: [ 48 'bip39', 49 'bn.js', 50 'classnames', 51 'ethereum-blockies-base64', 52 'ethereumjs-abi', 53 'ethereumjs-tx', 54 'ethereumjs-util', 55 'ethereumjs-wallet', 56 'hdkey', 57 'idna-uts46', 58 'jsonschema', 59 'lodash', 60 'moment', 61 'normalizr', 62 'qrcode', 63 'qrcode.react', 64 'query-string', 65 'react', 66 'react-dom', 67 'react-markdown', 68 'react-redux', 69 'react-router-dom', 70 'react-router-redux', 71 'react-transition-group', 72 'redux', 73 'redux-logger', 74 'redux-saga', 75 'scryptsy', 76 'uuid', 77 'wallet-address-validator', 78 'whatwg-fetch' 79 ] 80 };