remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
remix-project/apps/remixdesktop/webpack.config.js

43 lines
984 B

const path = require('path');
const nodeExternals = require('webpack-node-externals');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const mode = process.env.NODE_ENV || 'development';
const webpack = require('webpack');
module.exports = {
mode,
entry: {
main: './src/main.ts',
preload: './src/preload.ts',
},
target: 'electron-main',
module: {
rules: [
{
test: /\.ts$/,
include: /src/,
use: [{ loader: 'ts-loader' }]
},
{
test: /\.node$/,
use: 'node-loader'
}
]
},
resolve: {
extensions: ['.ts', '.js'],
plugins: [new TsconfigPathsPlugin({ configFile: './tsconfig.json' })]
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || mode)
})
],
output: {
path: path.resolve(__dirname, 'build'),
filename: '[name].js'
},
node: {
__dirname: false,
__filename: false
}
}