]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/config/webpack.video-embed.js
1 const helpers
= require('./helpers')
3 const CheckerPlugin
= require('awesome-typescript-loader').CheckerPlugin
4 const HtmlWebpackPlugin
= require('html-webpack-plugin')
5 const UglifyJsPlugin
= require('webpack/lib/optimize/UglifyJsPlugin')
6 const HashedModuleIdsPlugin
= require('webpack/lib/HashedModuleIdsPlugin')
7 const ExtractTextPlugin
= require('extract-text-webpack-plugin')
8 const PurifyCSSPlugin
= require('purifycss-webpack')
10 module
.exports = function (options
) {
11 const isProd
= options
&& options
.env
=== 'production'
13 const configuration
= {
15 'video-embed': './src/standalone/videos/embed.ts'
20 * An array of extensions that should be used to resolve modules.
22 * See: http://webpack.github.io/docs/configuration.html#resolve-extensions
24 extensions: [ '.ts', '.js', '.json', '.scss' ],
26 modules: [ helpers
.root('src'), helpers
.root('node_modules') ]
30 path: helpers
.root('dist/standalone/videos'),
31 filename: '[name].[hash].bundle.js',
32 sourceMapFilename: '[file].map',
33 chunkFilename: '[id].chunk.js',
34 publicPath: '/client/standalone/videos/'
44 loader: 'awesome-typescript-loader',
46 configFileName: 'tsconfig.webpack.json',
51 exclude: [/\.(spec|e2e)\.ts$/]
55 test: /\.(sass|scss)$/,
56 use: ExtractTextPlugin
.extract({
57 fallback: 'style-loader',
68 loader: 'sass-loader',
74 loader: 'sass-resources-loader',
77 helpers
.root('src/sass/_variables.scss'),
78 helpers
.root('src/sass/_mixins.scss')
90 helpers
.root('src/index.html'),
91 helpers
.root('src/standalone/videos/embed.html')
96 test: /\.(jpg|png|gif)$/,
100 { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, use: 'url-loader?limit=10000&minetype=application/font-woff' },
101 { test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, use: 'file-loader' }
107 new ExtractTextPlugin({
108 filename: '[name].[contenthash].css'
111 new PurifyCSSPlugin({
112 paths: [ helpers
.root('src/standalone/videos/embed.ts') ],
115 whitelist: [ '*vjs*', '*video-js*' ]
121 new HtmlWebpackPlugin({
122 template: 'src/standalone/videos/embed.html',
123 filename: 'embed.html',
125 chunksSortMode: 'dependency',
136 clearImmediate: false,
142 configuration
.module
.rules
.push(
144 test: /junk\/index\.js$/,
145 // exclude: /(node_modules|bower_components)/,
147 loader: 'babel-loader',
155 configuration
.plugins
.push(
175 negate_iife: false // we need this for lazy v8
179 new HashedModuleIdsPlugin()