BetterDiscordApp-v2/client/webpack.config.js

60 lines
1.4 KiB
JavaScript
Raw Normal View History

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: {
electron: 'window.require("electron")',
fs: 'window.require("fs")',
path: 'window.require("path")',
node_utils: 'window.require("util")',
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'),
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
}
};