mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #2488 from overleaf/as-import-pr-708
[Imported] Vendor web fonts, (#708) GitOrigin-RevId: b286a0d4bac9d84f70bf9d4ff99220f67ce67425
This commit is contained in:
@@ -5,7 +5,9 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
|
||||
const base = require('./webpack.config')
|
||||
|
||||
module.exports = merge(base, {
|
||||
// Use "smart" merge: attempts to combine loaders targeting the same file type,
|
||||
// overriding the base config
|
||||
module.exports = merge.smart(base, {
|
||||
mode: 'production',
|
||||
|
||||
// Enable a full source map. Generates a comment linking to the source map
|
||||
@@ -16,6 +18,26 @@ module.exports = merge(base, {
|
||||
filename: 'js/[name]-[chunkhash].js'
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
// Override base font loading to add hash to filename so that we can
|
||||
// use "immutable" caching
|
||||
test: /\.(woff|woff2)$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
outputPath: 'fonts',
|
||||
publicPath: '/fonts/',
|
||||
name: '[name]-[hash].[ext]'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
optimization: {
|
||||
// Minify JS (with Terser) and CSS (with cssnano)
|
||||
minimizer: [new TerserPlugin(), new OptimizeCssAssetsPlugin()]
|
||||
|
||||
Reference in New Issue
Block a user