ToolJet/frontend/webpack.config.js
Gandharv 64131825d9
Feature: Star rating widget ️ (#535)
* feat: add star rating widget

* add events, properties

* add the number of stars as variable

* fix animation

* add half star logic, properties, definations

* add hover index property

* on dismiss show star outline

* show tooltip on hover + fix half icon display on click

* make text inline

* feat: add import svg as react component

* update star rating component for managing color change

* fix: conflicts

* Delete half-star.svg

* Delete star.svg

* change default color to gold

* fix widget settings events

* add default selection of stars

* change default selection to 5

* css changes

* add star rating onchange fix
2021-08-25 20:44:55 +05:30

83 lines
1.7 KiB
JavaScript

var HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const environment = process.env.NODE_ENV === 'production' ? 'production' : 'development';
const API_URL = {
production: process.env.TOOLJET_SERVER_URL || '',
development: 'http://localhost:3000'
};
const ASSET_PATH = {
production: 'https://app.tooljet.io/',
development: '/public/'
};
module.exports = {
mode: 'development',
resolve: {
extensions: ['.js', '.jsx']
},
module: {
rules: [
{
test: /\.ttf$/,
use: ['file-loader']
},
{
test: /\.svg$/,
use: [
{
loader: '@svgr/webpack',
options: {
limit: 10000,
},
},
],
},
{
test: /\.jsx?$/,
loader: 'babel-loader'
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
{
test: /\.scss$/,
use: [{
loader: 'style-loader'
}, {
loader: 'css-loader'
}, {
loader: 'sass-loader'
}]
}
]
},
resolve: {
extensions: ['.js', '.jsx', '.png'],
alias: {
'@': path.resolve(__dirname, 'src/')
}
},
plugins: [new HtmlWebpackPlugin({
template: './src/index.html'
})],
devServer: {
historyApiFallback: true
},
output: {
publicPath: '/',
path: path.resolve(__dirname, 'build')
},
externals: {
// global app config object
config: JSON.stringify({
apiUrl: `${API_URL[environment] || ''}/api`,
assetPath: ASSET_PATH[environment],
GOOGLE_MAPS_API_KEY: process.env.GOOGLE_MAPS_API_KEY,
SERVER_IP: process.env.SERVER_IP
})
}
};