1
0
mirror of https://github.com/bitwarden/browser synced 2024-12-13 01:36:52 +01:00
bitwarden-estensione-browser/webpack.main.js
Oscar Hinton e6e79917f7
Bump dependencies (#848)
* Bump dependencies
2021-04-23 10:45:30 +02:00

71 lines
1.7 KiB
JavaScript

const path = require('path');
const { merge } = require('webpack-merge');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const nodeExternals = require('webpack-node-externals');
const common = {
module: {
rules: [
{
test: /\.ts$/,
enforce: 'pre',
loader: 'tslint-loader',
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules\/(?!(@bitwarden)\/).*/,
},
],
},
plugins: [],
resolve: {
extensions: ['.tsx', '.ts', '.js'],
alias: {
jslib: path.join(__dirname, 'jslib/src'),
tldjs: path.join(__dirname, 'jslib/src/misc/tldjs.noop'),
},
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'build'),
},
};
const main = {
mode: 'production',
target: 'electron-main',
node: {
__dirname: false,
__filename: false,
},
entry: {
'main': './src/entry.ts',
},
optimization: {
minimize: false,
},
module: {
rules: [
{
test: /\.node$/,
loader: 'node-loader',
},
],
},
plugins: [
new CleanWebpackPlugin(),
new CopyWebpackPlugin({
patterns: [
'./src/package.json',
{ from: './src/images', to: 'images' },
{ from: './src/locales', to: 'locales' },
]
}),
],
externals: [nodeExternals()],
};
module.exports = merge(common, main);