mirror of
https://github.com/desktop/desktop
synced 2024-10-31 11:07:25 +00:00
38 lines
820 B
JavaScript
38 lines
820 B
JavaScript
'use strict'
|
|
|
|
const path = require('path')
|
|
|
|
module.exports = {
|
|
entry: [
|
|
'./src/index'
|
|
],
|
|
output: {
|
|
filename: 'bundle.js',
|
|
path: path.join(__dirname, 'build'),
|
|
libraryTarget: 'commonjs2'
|
|
},
|
|
module: {
|
|
loaders: [
|
|
{
|
|
test: /\.tsx?$/,
|
|
loaders: ['babel', 'ts'],
|
|
include: path.join(__dirname, 'src')
|
|
}
|
|
]
|
|
},
|
|
resolve: {
|
|
extensions: ['', '.js', '.ts', '.tsx'],
|
|
packageMains: ['webpack', 'browser', 'web', 'browserify', ['jam', 'main'], 'main']
|
|
},
|
|
target: 'electron',
|
|
externals: function (context, request, callback) {
|
|
try {
|
|
// Attempt to resolve the module via Node
|
|
require.resolve(request)
|
|
callback(null, request)
|
|
} catch (e) {
|
|
// Node couldn't find it, so it must be user-aliased
|
|
callback()
|
|
}
|
|
}
|
|
}
|