aboutsummaryrefslogtreecommitdiff
path: root/build/webpack.base.conf.js
diff options
context:
space:
mode:
authorHJ <30-hj@users.noreply.git.pleroma.social>2019-12-03 20:15:06 +0000
committerHJ <30-hj@users.noreply.git.pleroma.social>2019-12-03 20:15:06 +0000
commit7b1d5a4f5c54e6ea549a3a69d180970305ff0715 (patch)
tree9cd41f164ddedd7b7aa7289eb431e10f06153bb7 /build/webpack.base.conf.js
parent5096bff16cc680b7253c05a7ffa1d1c18da727a8 (diff)
parentd37caeeded0ebe90a2e922205eed94b5cc4fcca4 (diff)
Merge branch '701' into 'develop'
Versioning the font resources using webpack Closes #701 See merge request pleroma/pleroma-fe!1017
Diffstat (limited to 'build/webpack.base.conf.js')
-rw-r--r--build/webpack.base.conf.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js
index f8968966..9313ec20 100644
--- a/build/webpack.base.conf.js
+++ b/build/webpack.base.conf.js
@@ -3,6 +3,7 @@ var config = require('../config')
var utils = require('./utils')
var projectRoot = path.resolve(__dirname, '../')
var ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin')
+var FontelloPlugin = require("fontello-webpack-plugin")
var env = process.env.NODE_ENV
// check env & config/index.js to decide weither to enable CSS Sourcemaps for the
@@ -11,6 +12,8 @@ var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap)
var cssSourceMapProd = (env === 'production' && config.build.productionSourceMap)
var useCssSourceMap = cssSourceMapDev || cssSourceMapProd
+var now = Date.now()
+
module.exports = {
entry: {
app: './src/main.js'
@@ -90,6 +93,14 @@ module.exports = {
new ServiceWorkerWebpackPlugin({
entry: path.join(__dirname, '..', 'src/sw.js'),
filename: 'sw-pleroma.js'
+ }),
+ new FontelloPlugin({
+ config: require('../static/fontello.json'),
+ name: 'fontello',
+ output: {
+ css: '[name].' + now + '.css', // [hash] is not supported. Use the current timestamp instead for versioning.
+ font: 'font/[name].' + now + '.[ext]'
+ }
})
]
}