ghost-keychain/packages/extension/webpack.config.js
Ivan Rukhavets 85db56cd0f Redesign (#203)
* Inject theme using styled-components' ThemeProvider (#3)

* Apply colors from design, styles refactoring (#5)

* Add new tip and accounts screen without accounts (#7)

* Sync with upstream (#10)

* Use Nunito font (#11)

* Create account first page (#14)

* Customizable identicon (#13)

* Inline buttons (#16)

* Welcome screen styling (#17)

* Account creation second step (#15)

* Add new header (#20)

* change welcome screen (#19)

* Account screen (#18)

* Update from upstream (#21)

* Window title (#25)

* New authorize (#24)

* Refactor and remove unnecessary stuff from theme (#22)

* refactor add  accounts screen (#29)

* Export and forget screens, change general padding to 24px (#27)

* Signing screen (#26)

* Import account screens (#31)

* Change header with settings (#28)

* Refactor button and mnemonic (#30)

* Restyle checkbox (#33)

* Remove opacity from background; add borders (#32)

* Code style polishing (#34)

* Move fileMock to __mocks__ (#35)

* Add light theme (#36)

* Small design changes (#38)

* Change background color (#39)

* Sync with upstream (#41)

* Update screenshots in readme

* [CI Skip]  0.14.0-beta.7

skip-checks: true

* fix error for display menu (#42)

* fix display of authorization (#43)

* firefox scrol (#45)

* small change for rename account (#44)

* Sync with upstream

* Print and back button (#48)

* delete print button and change cancel to back button

* Set body color (#49)

* Fix the fix of account rename (#52)

* Update generic sign screen (#47)

* Improve UI/UX design (#53)

* [CI Skip]  0.14.0-beta.10

skip-checks: true

* Improve QR code recognition on dark theme (#54)

* Add proper tx/sign texts and headers (#55)

Co-authored-by: Kamil Dąbrowski <kamil@ethworks.io>
2019-12-20 10:06:43 +01:00

115 lines
2.9 KiB
JavaScript

/* eslint-disable @typescript-eslint/no-var-requires */
// Copyright 2019 @polkadot/extension authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
const path = require('path');
const webpack = require('webpack');
const CopyPlugin = require('copy-webpack-plugin');
const ManifestPlugin = require('webpack-extension-manifest-plugin');
const pkgJson = require('./package.json');
const manifest = require('./manifest.json');
const packages = [
'extension',
'extension-chains',
'extension-inject',
'extension-ui'
];
function createWebpack ({ alias = {}, context }) {
const ENV = process.env.NODE_ENV || 'development';
const isProd = ENV === 'production';
return {
context,
devtool: false,
entry: {
background: './src/background/index.ts',
content: './src/content.ts',
extension: './src/extension.ts',
page: './src/page/index.ts'
},
mode: ENV,
output: {
chunkFilename: '[name].js',
filename: '[name].js',
globalObject: '(typeof self !== \'undefined\' ? self : this)',
path: path.join(context, 'build')
},
resolve: {
alias,
extensions: ['.js', '.jsx', '.ts', '.tsx']
},
module: {
rules: [
{
test: /\.(js|ts|tsx)$/,
exclude: /(node_modules)/,
use: [
require.resolve('thread-loader'),
{
loader: require.resolve('babel-loader'),
options: require('@polkadot/dev-react/config/babel')
}
]
},
{
test: [/\.svg$/, /\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/, /\.woff2?$/],
use: [
{
loader: require.resolve('url-loader'),
options: {
limit: 10000,
name: 'static/[name].[ext]'
}
}
]
}
]
},
node: {
// eslint-disable-next-line @typescript-eslint/camelcase
child_process: 'empty',
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty'
},
performance: {
hints: false
},
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(ENV),
PKG_NAME: JSON.stringify(pkgJson.name),
PKG_VERSION: JSON.stringify(pkgJson.version)
}
}),
new CopyPlugin([{ from: 'public' }]),
new ManifestPlugin({
config: {
base: manifest,
extend: {
version: pkgJson.version.split('-')[0] // remove possible -beta.xx
}
}
})
].filter((entry) => entry),
watch: !isProd
};
}
module.exports = createWebpack({
context: __dirname,
alias: packages.reduce((alias, pkg) => {
alias[`@polkadot/${pkg}`] = path.resolve(__dirname, `../${pkg}/src`);
return alias;
}, {})
});