2020-05-09 18:00:07 +00:00
|
|
|
const path = require('path');
|
|
|
|
const TerserPlugin = require('terser-webpack-plugin');
|
2022-02-04 21:37:09 +00:00
|
|
|
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
2020-05-09 18:00:07 +00:00
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
|
const webpack = require('webpack')
|
|
|
|
|
|
|
|
var debug=false;
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: [
|
|
|
|
'./browser_app/index.js',
|
|
|
|
'./browser_app/style.scss'
|
|
|
|
],
|
|
|
|
output: {
|
|
|
|
filename: '[name].js',
|
2022-02-19 09:21:00 +00:00
|
|
|
path: path.resolve(__dirname, 'lenticular_cloud/static'),
|
2020-05-09 18:00:07 +00:00
|
|
|
},
|
|
|
|
devtool: "source-map",
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
"test": /\.tsx?$/,
|
|
|
|
"exclude": /node_modules/,
|
|
|
|
"use": {
|
|
|
|
"loader": "ts-loader",
|
|
|
|
"options": {
|
|
|
|
"transpileOnly": true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.s[ac]ss$/i,
|
|
|
|
use:[
|
|
|
|
MiniCssExtractPlugin.loader,
|
|
|
|
'css-loader',
|
|
|
|
'sass-loader'
|
|
|
|
]
|
|
|
|
},
|
2022-02-19 09:21:00 +00:00
|
|
|
{
|
|
|
|
"test": /\.(svg|eot|woff|woff2|ttf)$/,
|
|
|
|
type: 'asset/resource',
|
|
|
|
},
|
2020-05-09 18:00:07 +00:00
|
|
|
{
|
|
|
|
test: /\.css$/,
|
|
|
|
use: ['style-loader', 'css-loader'],
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"optimization": {
|
|
|
|
minimize: !debug,
|
|
|
|
minimizer: [
|
|
|
|
new TerserPlugin({
|
|
|
|
include: /\.js$/
|
|
|
|
}),
|
2022-02-04 21:37:09 +00:00
|
|
|
new CssMinimizerPlugin({
|
2020-05-09 18:00:07 +00:00
|
|
|
include: /\.css$/
|
|
|
|
})
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"plugins": [
|
|
|
|
new webpack.ProvidePlugin({
|
|
|
|
$: "jquery",
|
|
|
|
jQuery: "jquery"
|
|
|
|
}),
|
|
|
|
new MiniCssExtractPlugin(),
|
2022-02-04 21:37:09 +00:00
|
|
|
],
|
|
|
|
// workaround for qrcode-svg
|
|
|
|
"resolve": {
|
|
|
|
"fallback": {
|
|
|
|
"fs": false,
|
|
|
|
}
|
|
|
|
}
|
2020-05-09 18:00:07 +00:00
|
|
|
};
|