mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-01-11 22:40:31 +00:00
72 lines
No EOL
2 KiB
JavaScript
72 lines
No EOL
2 KiB
JavaScript
const path = require('path');
|
|
const HtmlWebPackPlugin = require('html-webpack-plugin');
|
|
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
|
|
|
module.exports = {
|
|
entry: './src/index.js',
|
|
output: {
|
|
path: path.join(__dirname, 'dist'),
|
|
filename: 'bundle.js'
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: 'babel-loader'
|
|
}
|
|
},
|
|
{
|
|
test: /\.less$/,
|
|
exclude: /node_modules/,
|
|
use: [
|
|
{
|
|
loader: 'style-loader'
|
|
},
|
|
{
|
|
loader: 'css-loader',
|
|
options: {
|
|
modules: true,
|
|
localIdentName: '[hash:base64:5]'
|
|
}
|
|
},
|
|
{
|
|
loader: 'less-loader',
|
|
options: {
|
|
strictMath: true,
|
|
noIeCompat: true,
|
|
compress: true,
|
|
paths: [
|
|
path.resolve(__dirname, 'node_modules/stremio-colors')
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
resolve: {
|
|
extensions: ['.js', '.json', '.css', '.less'],
|
|
alias: {
|
|
'stremio-common': path.resolve(__dirname, 'src/common')
|
|
}
|
|
},
|
|
plugins: [
|
|
new HtmlWebPackPlugin({
|
|
template: './src/index.html'
|
|
}),
|
|
new UglifyJsPlugin({
|
|
test: /\.js$/,
|
|
uglifyOptions: {
|
|
mangle: true,
|
|
output: {
|
|
ecma: 5,
|
|
comments: false,
|
|
beautify: false,
|
|
wrap_iife: true
|
|
}
|
|
}
|
|
})
|
|
]
|
|
}; |