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-03-20 22:11:11 +01:00
|
|
|
electron: 'window.require("electron")',
|
|
|
|
fs: 'window.require("fs")',
|
|
|
|
path: 'window.require("path")',
|
2018-03-25 03:18:40 +02:00
|
|
|
node_utils: 'window.require("util")',
|
2018-03-20 22:11:11 +01:00
|
|
|
sparkplug: 'require("../../core/dist/sparkplug")'
|
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-01-11 15:12:24 +01:00
|
|
|
}
|
2018-02-21 02:16:41 +01:00
|
|
|
};
|