2018-03-21 16:57:10 +01:00
|
|
|
const path = require('path');
|
|
|
|
const webpack = require('webpack');
|
2018-01-10 21:48:10 +01:00
|
|
|
|
|
|
|
const jsLoader = {
|
|
|
|
test: /\.(js|jsx)$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
loader: 'babel-loader',
|
|
|
|
query: {
|
2018-01-19 02:37:21 +01:00
|
|
|
presets: ['react']
|
2018-01-10 21:48:10 +01:00
|
|
|
}
|
2018-03-21 16:57:10 +01:00
|
|
|
};
|
2018-01-10 21:48:10 +01:00
|
|
|
|
2018-01-19 03:10:10 +01:00
|
|
|
const vueLoader = {
|
|
|
|
test: /\.(vue)$/,
|
|
|
|
loader: 'vue-loader'
|
2018-03-21 16:57:10 +01:00
|
|
|
};
|
2018-01-19 03:10:10 +01:00
|
|
|
|
2018-01-19 06:17:07 +01:00
|
|
|
const scssLoader = {
|
|
|
|
test: /\.scss$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
loader: ['css-loader', 'sass-loader']
|
2018-03-21 16:57:10 +01:00
|
|
|
};
|
2018-01-19 06:17:07 +01:00
|
|
|
|
2018-01-10 21:48:10 +01:00
|
|
|
module.exports = {
|
|
|
|
entry: './src/index.js',
|
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, 'dist'),
|
|
|
|
filename: 'betterdiscord.client.js'
|
|
|
|
},
|
|
|
|
module: {
|
2018-01-19 06:17:07 +01:00
|
|
|
loaders: [jsLoader, vueLoader, scssLoader]
|
2018-01-11 00:46:05 +01:00
|
|
|
},
|
2018-01-11 15:12:24 +01:00
|
|
|
externals: {
|
2018-07-07 19:53:16 +02:00
|
|
|
electron: 'require("electron")',
|
|
|
|
fs: 'require("fs")',
|
|
|
|
path: 'require("path")',
|
|
|
|
util: 'require("util")',
|
|
|
|
process: 'require("process")',
|
|
|
|
net: 'require("net")',
|
2018-07-22 00:10:33 +02:00
|
|
|
request: 'require(require("path").join(require("electron").remote.app.getAppPath(), "node_modules", "request"))',
|
2018-08-11 08:06:28 +02:00
|
|
|
sparkplug: 'require("../../core/dist/sparkplug")',
|
2018-08-12 20:43:59 +02:00
|
|
|
'node-crypto': 'require("crypto")'
|
2018-01-19 03:10:10 +01:00
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
2018-01-21 14:41:56 +01:00
|
|
|
vue$: path.resolve('..', 'node_modules', 'vue', 'dist', 'vue.esm.js')
|
2018-01-30 14:20:24 +01:00
|
|
|
},
|
|
|
|
modules: [
|
|
|
|
path.resolve('..', 'node_modules'),
|
|
|
|
path.resolve('..', 'common', 'modules'),
|
|
|
|
path.resolve('src', 'modules'),
|
2018-02-07 12:52:59 +01:00
|
|
|
path.resolve('src', 'ui'),
|
2018-02-07 15:41:10 +01:00
|
|
|
path.resolve('src', 'plugins'),
|
2018-03-07 00:37:14 +01:00
|
|
|
path.resolve('src', 'structs'),
|
|
|
|
path.resolve('src', 'builtin')
|
2018-01-30 14:20:24 +01:00
|
|
|
]
|
2018-03-21 16:57:10 +01:00
|
|
|
},
|
|
|
|
node: {
|
|
|
|
process: false,
|
|
|
|
__filename: false,
|
|
|
|
__dirname: false
|
2018-07-07 20:52:13 +02:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.NamedModulesPlugin(),
|
|
|
|
new webpack.EvalSourceMapDevToolPlugin()
|
|
|
|
]
|
2018-02-21 02:16:41 +01:00
|
|
|
};
|