mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-18 14:16:05 +00:00
bootstrap 5 WIP (#7891)
New standard theme that follows your chosen terminal colors, Bootstrap 5 & Angular 15 upgrade
This commit is contained in:
77
web/webpack.config.mjs
Normal file
77
web/webpack.config.mjs
Normal file
@@ -0,0 +1,77 @@
|
||||
import * as path from 'path'
|
||||
import * as url from 'url'
|
||||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
|
||||
|
||||
|
||||
const externals = {}
|
||||
for (const key of [
|
||||
'child_process',
|
||||
'crypto',
|
||||
'dns',
|
||||
'fs',
|
||||
'http',
|
||||
'https',
|
||||
'net',
|
||||
'path',
|
||||
'querystring',
|
||||
'tls',
|
||||
'tty',
|
||||
'zlib',
|
||||
'../build/Release/cpufeatures.node',
|
||||
'./crypto/build/Release/sshcrypto.node',
|
||||
]) {
|
||||
externals[key] = `commonjs ${key}`
|
||||
}
|
||||
|
||||
const config = {
|
||||
name: 'tabby-web-entry',
|
||||
target: 'web',
|
||||
entry: {
|
||||
preload: path.resolve(__dirname, 'entry.preload.ts'),
|
||||
bundle: path.resolve(__dirname, 'entry.ts'),
|
||||
},
|
||||
mode: process.env.TABBY_DEV ? 'development' : 'production',
|
||||
optimization:{
|
||||
minimize: false,
|
||||
},
|
||||
context: __dirname,
|
||||
devtool: 'source-map',
|
||||
output: {
|
||||
path: path.join(__dirname, 'dist'),
|
||||
pathinfo: true,
|
||||
filename: '[name].js',
|
||||
publicPath: 'auto',
|
||||
},
|
||||
resolve: {
|
||||
modules: ['../app/node_modules', 'node_modules', '../node_modules', '../app/assets/'].map(x => path.join(__dirname, x)),
|
||||
extensions: ['.ts', '.js'],
|
||||
fallback: {
|
||||
stream: path.join(__dirname, 'node_modules/stream-browserify/index.js'),
|
||||
assert: path.join(__dirname, 'node_modules/assert/assert.js'),
|
||||
constants: path.join(__dirname, 'node_modules/constants-browserify/constants.json'),
|
||||
util: path.join(__dirname, 'node_modules/util/util.js'),
|
||||
},
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.ts$/,
|
||||
use: {
|
||||
loader: 'ts-loader',
|
||||
options: {
|
||||
configFile: path.resolve(__dirname, 'tsconfig.json'),
|
||||
},
|
||||
},
|
||||
},
|
||||
{ test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
|
||||
{ test: /\.css$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
|
||||
{
|
||||
test: /\.(png|svg|ttf|eot|otf|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
|
||||
type: 'asset',
|
||||
},
|
||||
],
|
||||
},
|
||||
externals,
|
||||
}
|
||||
|
||||
export default () => config
|
Reference in New Issue
Block a user