2019-12-24 15:40:03 +03:00
|
|
|
const path = require('path')
|
|
|
|
const nodeExternals = require('webpack-node-externals')
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: {
|
2021-01-30 18:15:47 +03:00
|
|
|
'api/cli': './src/api/cli.ts',
|
2019-12-28 02:34:24 +03:00
|
|
|
'api/tauricon': './src/api/tauricon.ts',
|
2020-07-16 00:01:37 +03:00
|
|
|
'api/dependency-manager': './src/api/dependency-manager/index.ts',
|
2021-01-30 18:15:47 +03:00
|
|
|
'helpers/spawn': './src/helpers/spawn.ts',
|
2021-04-14 04:09:13 +03:00
|
|
|
'helpers/rust-cli': './src/helpers/rust-cli.ts',
|
|
|
|
'helpers/download-cli': './src/helpers/download-cli.ts'
|
2019-12-24 15:40:03 +03:00
|
|
|
},
|
|
|
|
mode: process.env.NODE_ENV || 'development',
|
|
|
|
devtool: 'source-map',
|
|
|
|
module: {
|
2020-08-19 05:36:46 +03:00
|
|
|
rules: [
|
|
|
|
{
|
2019-12-24 15:40:03 +03:00
|
|
|
test: /\.tsx?$/,
|
|
|
|
use: 'ts-loader',
|
|
|
|
exclude: /node_modules/
|
2020-03-09 23:57:27 +03:00
|
|
|
},
|
|
|
|
{
|
2020-06-27 18:20:00 +03:00
|
|
|
test: /(templates|api)[\\/].+\.js/,
|
2020-03-09 23:57:27 +03:00
|
|
|
use: 'raw-loader'
|
2020-06-18 19:53:41 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.toml?$/,
|
|
|
|
use: 'toml-loader'
|
2019-12-24 15:40:03 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
node: false,
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.ts', '.js']
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
library: 'tauri',
|
|
|
|
libraryTarget: 'umd',
|
|
|
|
filename: '[name].js',
|
2021-04-21 15:42:09 +03:00
|
|
|
path: path.resolve(__dirname, 'dist'),
|
|
|
|
globalObject: 'this'
|
2019-12-24 15:40:03 +03:00
|
|
|
},
|
2021-04-21 15:42:09 +03:00
|
|
|
externals: [
|
|
|
|
nodeExternals({
|
2021-04-23 17:10:49 +03:00
|
|
|
allowlist: ['imagemin', 'is-png', 'p-pipe', 'file-type']
|
2021-04-21 15:42:09 +03:00
|
|
|
})
|
|
|
|
],
|
|
|
|
externalsPresets: { node: true }
|
2019-12-24 15:40:03 +03:00
|
|
|
}
|