Merge pull request #1021 from davidmehren/webpack-4

Webpack: Cleanup common config
This commit is contained in:
Christoph (Sheogorath) Kern 2018-10-19 14:42:02 +02:00 committed by GitHub
commit 26a65322a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 15 deletions

View File

@ -1,12 +1,12 @@
var webpack = require('webpack') const webpack = require('webpack')
var path = require('path') const path = require('path')
var HtmlWebpackPlugin = require('html-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin')
var CopyWebpackPlugin = require('copy-webpack-plugin') const CopyWebpackPlugin = require('copy-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin')
// Fix possible nofile-issues // Fix possible nofile-issues
var fs = require('fs') const fs = require('fs')
var gracefulFs = require('graceful-fs') const gracefulFs = require('graceful-fs')
gracefulFs.gracefulify(fs) gracefulFs.gracefulify(fs)
module.exports = { module.exports = {
@ -392,7 +392,7 @@ module.exports = {
module: { module: {
rules: [{ rules: [{
test: /\.js$/, test: /\.js$/,
use: [{loader: 'babel-loader'}], use: [{ loader: 'babel-loader' }],
exclude: [/node_modules/, /public\/vendor/] exclude: [/node_modules/, /public\/vendor/]
}, { }, {
test: /\.css$/, test: /\.css$/,
@ -428,43 +428,43 @@ module.exports = {
test: require.resolve('js-sequence-diagrams'), test: require.resolve('js-sequence-diagrams'),
use: [{ use: [{
loader: 'imports-loader', loader: 'imports-loader',
options: {_: 'lodash', Raphael: 'raphael', eve: 'eve'} options: { _: 'lodash', Raphael: 'raphael', eve: 'eve' }
}] }]
}, { }, {
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
use: [{loader: 'file-loader'}] use: [{ loader: 'file-loader' }]
}, { }, {
test: /\.html$/, test: /\.html$/,
use: [{loader: 'string-loader'}] use: [{ loader: 'string-loader' }]
}, { }, {
test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/,
use: [{ use: [{
loader: 'url-loader', loader: 'url-loader',
options: {prefix: 'font/', limit: '5000'} options: { prefix: 'font/', limit: '5000' }
}] }]
}, { }, {
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
use: [{ use: [{
loader: 'url-loader', loader: 'url-loader',
options: {limit: '5000', mimetype: 'application/octet-stream'} options: { limit: '5000', mimetype: 'application/octet-stream' }
}] }]
}, { }, {
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
use: [{ use: [{
loader: 'url-loader', loader: 'url-loader',
options: {limit: '10000', mimetype: 'svg+xml'} options: { limit: '10000', mimetype: 'svg+xml' }
}] }]
}, { }, {
test: /\.png(\?v=\d+\.\d+\.\d+)?$/, test: /\.png(\?v=\d+\.\d+\.\d+)?$/,
use: [{ use: [{
loader: 'url-loader', loader: 'url-loader',
options: {limit: '10000', mimetype: 'image/png'} options: { limit: '10000', mimetype: 'image/png' }
}] }]
}, { }, {
test: /\.gif(\?v=\d+\.\d+\.\d+)?$/, test: /\.gif(\?v=\d+\.\d+\.\d+)?$/,
use: [{ use: [{
loader: 'url-loader', loader: 'url-loader',
options: {limit: '10000', mimetype: 'image/gif'} options: { limit: '10000', mimetype: 'image/gif' }
}] }]
}] }]
}, },