Create new repository to host all dashboard developments
This project contains the commons components and all the dashboard instances
const path = require('path');
// const nodeExternals = require('webpack-node-externals');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
entry: path.resolve(__dirname, 'src/index.js'),
output: {
path: path.resolve(__dirname, 'lib'),
filename: 'dashboard-components.js',
library: '',
libraryTarget: 'commonjs2',
},
resolve: {
extensions: ['.wasm', '.mjs', '.js', '.json', '.jsx'],
},
// externals: [nodeExternals()],
target: 'web',
module: {
rules: [
{
test: /\.(js|jsx)$/,
enforce: 'pre',
exclude: /node_modules/,
loader: 'eslint-loader',
options: {
emitWarning: true,
failOnWarning: true,
failOnError: true,
},
},
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react'],
plugins: ['@babel/plugin-proposal-class-properties'],
},
},
{
test: /\.s[c|a]ss$/,
use: ['style-loader', MiniCssExtractPlugin.loader, 'css-loader', 'postcss-loader', 'sass-loader'],
},
{
test: /\.(png|jpg|gif)$/i,
use: [
{
loader: 'url-loader',
options: {
limit: 8192,
},
},
],
},
],
},
plugins: [
new MiniCssExtractPlugin({
filename: 'dashboard-components.css',
}),
],
performance: {
hints: false,
},
};