1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-27 21:05:53 +00:00

The Great Webpack Update.

* Update to version 4 of webpack.
* For that matter, update *every dependency* to the latest available version.
* Remove the babel build target for Edge, as it doesn't seem to be necessary with webpack 4 and tenser.
* Add support for optional chaining and nullish coalescing via Babel transformations.
* Update the clips domain version to work better. Or at all, really.
* Remove unused code from i18n.
* Remove the last `<style>` from vue component files. They don't work that way now anyways.
* Fix a bug in Raven's report handler.
* Fix a bug with the menu button in browsers that don't understand `:scope` within `querySelector()`.
This commit is contained in:
SirStendec 2019-06-19 20:57:14 -04:00
parent 567708b7f1
commit 014eb203c3
31 changed files with 3106 additions and 5715 deletions

View file

@ -1,7 +1,11 @@
const webpack = require('webpack');
const path = require('path');
/* global module __dirname */
const VueLoaderPlugin = require('vue-loader/lib/plugin');
/* global process module __dirname */
const PRODUCTION = process.env.NODE_ENV === 'production';
module.exports = {
entry: {
@ -30,7 +34,15 @@ module.exports = {
jsonpFunction: 'ffzWebpackJsonp',
crossOriginLoading: 'anonymous'
},
optimization: {
splitChunks: {
cacheGroups: {
vendors: false
}
}
},
plugins: [
new VueLoaderPlugin(),
new webpack.ExtendedAPIPlugin()
],
module: {
@ -39,7 +51,7 @@ module.exports = {
use: [{
loader: 'file-loader',
options: {
name: '[name].css'
name: PRODUCTION ? '[name].[hash].css' : '[name].css'
}
}, {
loader: 'extract-loader'
@ -55,10 +67,35 @@ module.exports = {
}
}]
},
{
test: /\.json$/,
include: /src/,
type: 'javascript/auto',
loader: 'file-loader',
options: {
name: PRODUCTION ? '[name].[hash].json' : '[name].json'
}
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
cacheDirectory: true
}
},
{
test: /\.jsx$/,
exclude: /node_modules/,
loader: 'babel-loader'
loader: 'babel-loader',
options: {
cacheDirectory: true,
plugins: [
['@babel/plugin-transform-react-jsx', {
pragma: 'createElement'
}]
]
}
},
{
test: /\.(graphql|gql)$/,
@ -70,7 +107,7 @@ module.exports = {
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]'
name: PRODUCTION ? '[name].[hash].[ext]' : '[name].[ext]'
}
}]
},