const helpers = require('./helpers')
+const path = require('path')
const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin
const HtmlWebpackPlugin = require('html-webpack-plugin')
const configuration = {
entry: {
- 'video-embed': './src/standalone/videos/embed.ts'
+ 'video-embed': './src/standalone/videos/embed.ts',
+ 'player': './src/standalone/player/player.ts',
+ 'test-embed': './src/standalone/videos/test-embed.ts'
},
resolve: {
*/
extensions: [ '.ts', '.js', '.json', '.scss' ],
- modules: [ helpers.root('src'), helpers.root('node_modules') ]
+ modules: [ helpers.root('src'), helpers.root('node_modules') ],
+
+ alias: {
+ 'video.js$': path.resolve('node_modules/video.js/dist/alt/video.core.js')
+ }
},
output: {
publicPath: '/client/standalone/videos/'
},
+ // devtool: 'source-map',
+
module: {
rules: [
use: 'raw-loader',
exclude: [
helpers.root('src/index.html'),
- helpers.root('src/standalone/videos/embed.html')
+ helpers.root('src/standalone/videos/embed.html'),
+ helpers.root('src/standalone/videos/test-embed.html')
]
},
plugins: [
new ExtractTextPlugin({
- filename: '[name].[contenthash].css'
+ filename: '[name].[hash].css'
}),
new PurifyCSSPlugin({
- paths: [ helpers.root('src/standalone/videos/embed.ts') ],
+ paths: [
+ helpers.root('src/standalone/videos/embed.ts'),
+ helpers.root('src/standalone/videos/test-embed.html')
+ ],
purifyOptions: {
minify: true,
whitelist: [ '*vjs*', '*video-js*' ]
filename: 'embed.html',
title: 'PeerTube',
chunksSortMode: 'dependency',
- inject: 'body'
+ inject: 'body',
+ chunks: ['video-embed']
+ }),
+
+ new HtmlWebpackPlugin({
+ template: '!!html-loader!src/standalone/videos/test-embed.html',
+ filename: 'test-embed.html',
+ title: 'PeerTube',
+ chunksSortMode: 'dependency',
+ inject: 'body',
+ chunks: ['test-embed']
}),
/**
})
],
+ performance: {
+ maxEntrypointSize: 700000, // 600kB
+ maxAssetSize: 700000
+ },
+
node: {
global: true,
crypto: 'empty',