]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/config/webpack.video-embed.js
fe40194cf3a010fd5c9b35262e8865ecc1f2f27e
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')
89 helpers
.root('src/index.html'),
90 helpers
.root('src/standalone/videos/embed.html')
95 test: /\.(jpg|png|gif)$/,
99 { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, use: 'url-loader?limit=10000&minetype=application/font-woff' },
100 { test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, use: 'file-loader' }
106 new ExtractTextPlugin({
107 filename: '[name].[contenthash].css'
110 new PurifyCSSPlugin({
111 paths: [ helpers
.root('src/standalone/videos/embed.ts') ],
114 whitelist: [ '*vjs*', '*video-js*' ]
120 new HtmlWebpackPlugin({
121 template: 'src/standalone/videos/embed.html',
122 filename: 'embed.html',
124 chunksSortMode: 'dependency',
135 clearImmediate: false,
141 configuration
.module
.rules
.push(
143 test: /junk\/index\.js$/,
144 // exclude: /(node_modules|bower_components)/,
146 loader: 'babel-loader',
154 configuration
.plugins
.push(
174 negate_iife: false // we need this for lazy v8
178 new HashedModuleIdsPlugin()