config files on 28-11-2023 12:46:43
This commit is contained in:
300
www/community/lovelace-flower-card/flower-card.js
Normal file
300
www/community/lovelace-flower-card/flower-card.js
Normal file
File diff suppressed because one or more lines are too long
45
www/community/lovelace-flower-card/webpack.config.js
Normal file
45
www/community/lovelace-flower-card/webpack.config.js
Normal file
@@ -0,0 +1,45 @@
|
||||
const webpack = require('webpack');
|
||||
const path = require('path');
|
||||
const compressionPlugin = require('compression-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
mode: 'production',
|
||||
entry: path.resolve(__dirname, 'src', 'flower-card.ts'),
|
||||
output: {
|
||||
filename: 'flower-card.js',
|
||||
path: path.resolve(__dirname),
|
||||
},
|
||||
optimization: {
|
||||
minimize: true
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /(node_modules)/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['@babel/preset-env'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
}
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.NODE_ENV': JSON.stringify('production'),
|
||||
}),
|
||||
new compressionPlugin({
|
||||
test: /\.js(\?.*)?$/i,
|
||||
}),
|
||||
],
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx', '.ts', '.tsx']
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user