Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/browser-extension-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
"scripts": {
"build": "run-s cleanup:dist build:project",
"build:app": "NODE_OPTIONS='--openssl-legacy-provider' run -T webpack --config webpack.app.${WEBPACK_ENV:-prod}.js --progress",
"build:cs": "NODE_OPTIONS='--openssl-legacy-provider' run -T webpack --config webpack.cs.${WEBPACK_ENV:-prod}.js --progress",
"build:dev": "WEBPACK_ENV=dev yarn build",
"build:firefox": "BROWSER=firefox yarn build",
"build:firefox:dev": "WEBPACK_ENV=dev yarn build:firefox",
"build:project": "run-p build:sw build:app",
"build:project": "run-p build:sw build:app build:cs",
"build:sw": "NODE_OPTIONS='--openssl-legacy-provider' run -T webpack --config webpack.sw.${WEBPACK_ENV:-prod}.js --progress",
"cleanup": "run-p cleanup:*",
"cleanup:dist": "rm -rf dist",
Expand Down
2 changes: 0 additions & 2 deletions apps/browser-extension-wallet/webpack.common.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ module.exports = () =>
entry: {
popup: withMaybeSentry(path.join(__dirname, 'src/index-popup.tsx')),
options: withMaybeSentry(path.join(__dirname, 'src/index-options.tsx')),
content: path.join(__dirname, 'src/lib/scripts/background/content.ts'),
inject: path.join(__dirname, 'src/lib/scripts/background/inject.ts'),
dappConnector: withMaybeSentry(path.join(__dirname, 'src/index-dapp-connector.tsx')),
['trezor-content-script']: path.join(__dirname, 'src/lib/scripts/trezor/trezor-content-script.ts'),
['trezor-usb-permissions']: withMaybeSentry(
Expand Down
26 changes: 26 additions & 0 deletions apps/browser-extension-wallet/webpack.common.cs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const path = require('path');
const { merge } = require('webpack-merge');
const commonConfig = require('./webpack.common');

require('dotenv-defaults').config({
path: './.env',
encoding: 'utf8',
defaults: process.env.BUILD_DEV_PREVIEW === 'true' ? './.env.developerpreview' : './.env.defaults'
});

module.exports = () =>
merge(commonConfig(), {
entry: {
content: path.join(__dirname, 'src/lib/scripts/background/content.ts'),
inject: path.join(__dirname, 'src/lib/scripts/background/inject.ts')
},
output: {
path: path.join(__dirname, 'dist/app'),
filename: '[name].js',
// the following setting is required for SRI to work:
crossOriginLoading: 'anonymous'
},
experiments: {
syncWebAssembly: true
}
});
11 changes: 11 additions & 0 deletions apps/browser-extension-wallet/webpack.cs.dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { merge } = require('webpack-merge');

const commonDevConfig = require('./webpack.common.dev');
const commonCsConfig = require('./webpack.common.cs');
require('dotenv-defaults').config({
path: './.env',
encoding: 'utf8',
defaults: process.env.BUILD_DEV_PREVIEW === 'true' ? './.env.developerpreview' : './.env.defaults'
});

module.exports = (env) => merge(commonDevConfig({ devServerPort: 3001 })(env), commonCsConfig());
27 changes: 27 additions & 0 deletions apps/browser-extension-wallet/webpack.cs.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { merge } = require('webpack-merge');
const commonProdConfig = require('./webpack.common.prod');
const commonCsConfig = require('./webpack.common.cs');

require('dotenv-defaults').config({
path: './.env',
encoding: 'utf8',
defaults: process.env.BUILD_DEV_PREVIEW === 'true' ? './.env.developerpreview' : './.env.defaults'
});

module.exports = () =>
merge(commonProdConfig(), commonCsConfig(), {
optimization: {
splitChunks: {
maxSize: 4000000,
cacheGroups: {
vendors: {
test: /[/\\]node_modules[/\\]/,
enforce: true,
priority: -20,
chunks: 'async',
reuseExistingChunk: true
}
}
}
}
});
Loading