const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
const InlineManifestWebpackPlugin = require('inline-manifest-webpack-plugin')
const ngcWebpack = require('ngc-webpack')
+const CopyWebpackPlugin = require('copy-webpack-plugin')
const WebpackNotifierPlugin = require('webpack-notifier')
inject: 'body'
}),
+ new CopyWebpackPlugin([
+ {
+ from: helpers.root('src/assets/images/favicon.png'),
+ to: 'assets/images/favicon.png'
+ },
+ {
+ from: helpers.root('src/assets/images/default-avatar.png'),
+ to: 'assets/images/default-avatar.png'
+ }
+ ]),
+
/*
* Plugin: ScriptExtHtmlWebpackPlugin
* Description: Enhances html-webpack-plugin functionality
getAvatarPath () {
if (this.account && this.account.avatar) return this.account.avatar.path
- return '/assets/images/default-avatar.png'
+ return '/client/assets/images/default-avatar.png'
}
}
<!-- open graph and oembed tags -->
<!-- Do not remove it! -->
- <link rel="icon" type="image/png" href="/client/assets/favicon.png" />
+ <link rel="icon" type="image/png" href="/client/assets/images/favicon.png" />
<!-- base url -->
<base href="<%= htmlWebpackPlugin.options.metadata.baseUrl %>">
const clientsRouter = express.Router()
const distPath = join(root(), 'client', 'dist')
+const assetsImagesPath = join(root(), 'client', 'dist', 'assets', 'images')
const embedPath = join(distPath, 'standalone', 'videos', 'embed.html')
const indexPath = join(distPath, 'index.html')
// Static HTML/CSS/JS client files
clientsRouter.use('/client', express.static(distPath, { maxAge: STATIC_MAX_AGE }))
+clientsRouter.use('/client/assets/images', express.static(assetsImagesPath, { maxAge: STATIC_MAX_AGE }))
// 404 for static files not found
clientsRouter.use('/client/*', (req: express.Request, res: express.Response, next: express.NextFunction) => {