mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 17:52:29 +08:00
52 lines
1.1 KiB
JavaScript
52 lines
1.1 KiB
JavaScript
/* eslint-disable */
|
|
|
|
const path = require('path');
|
|
|
|
const platform = process.env.WAILSPLATFORM;
|
|
if (!platform) {
|
|
console.error("FATAL: Environment variable WAILSPLATFORM not set!");
|
|
process.exit(1);
|
|
}
|
|
|
|
module.exports = {
|
|
entry: './core/desktop',
|
|
mode: 'production',
|
|
output: {
|
|
path: path.resolve(__dirname, '..', 'assets'),
|
|
filename: 'desktop.js',
|
|
library: 'Wails'
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
ipc$: path.resolve(__dirname, 'desktop/ipc.js'),
|
|
platform$: path.resolve(__dirname, `desktop/${platform}.js`)
|
|
}
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.m?js$/,
|
|
exclude: /(node_modules|bower_components)/,
|
|
use: {
|
|
loader: 'babel-loader',
|
|
options: {
|
|
plugins: ['@babel/plugin-transform-object-assign'],
|
|
presets: [
|
|
[
|
|
'@babel/preset-env',
|
|
{
|
|
'useBuiltIns': 'entry',
|
|
'corejs': {
|
|
'version': 3,
|
|
'proposals': true
|
|
}
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
};
|