react-cascading-menu
Version:
React-Cascading-Menu is a multi-selectable cascading menu component for React, providing horizontal navigation and global search for efficient option selection.
58 lines (56 loc) • 1.35 kB
JavaScript
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const createStyledComponentsTransformer =
require("typescript-plugin-styled-components").default;
const webpack = require("webpack");
const styledComponentsTransformer = createStyledComponentsTransformer();
module.exports = {
mode: "production",
entry: "./src/index.tsx",
output: {
path: path.resolve(__dirname, "build"),
filename: "index.js",
libraryTarget: "commonjs2",
},
externals: {
react: "react",
"react-dom": "react-dom",
},
resolve: {
alias: {
"react-cascading-menu": path.resolve(__dirname, "build"),
},
extensions: [".ts", ".tsx"],
},
module: {
rules: [
{
test: /\.tsx?$/,
use: {
loader: "ts-loader",
options: {
getCustomTransformers: () => ({
before: [styledComponentsTransformer],
}),
},
},
exclude: /node_modules/,
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
{
test: /\.svg$/,
use: [
{
loader: "@svgr/webpack",
options: {
svgo: false,
},
},
],
},
],
},
};