mirror of
https://github.com/getredash/redash.git
synced 2025-12-25 01:03:20 -05:00
Separate visualizations into their own package (#4837)
* Add visualizations project settings * Move visualizations to redash-visualizations * Delete shared components * Remove antd from deps * Remove p-r-5 from table utils * Remove visualization deps from package.json * Rename package and change its version * Test preinstall script * Update Dockerfile build for frontend * Test adding dockerignore * Update jest tests * Add step for jest tests * Include viz-lib on dev commands * User prettier v1 for now * Delete unused libs on the app * Add readme draft (to be finished) * Add getOptions to Editor * Add required libraries and finish basic example * Bump version
This commit is contained in:
65
viz-lib/webpack.config.js
Normal file
65
viz-lib/webpack.config.js
Normal file
@@ -0,0 +1,65 @@
|
||||
const LessPluginAutoPrefix = require("less-plugin-autoprefix");
|
||||
const path = require("path");
|
||||
|
||||
const isProduction = process.env.NODE_ENV === "production";
|
||||
|
||||
module.exports = {
|
||||
mode: isProduction ? "production" : "development",
|
||||
entry: "./src/index.js",
|
||||
output: {
|
||||
path: path.resolve(__dirname, "dist"),
|
||||
filename: "redash-visualizations.js",
|
||||
libraryTarget: "umd",
|
||||
},
|
||||
resolve: {
|
||||
symlinks: false,
|
||||
extensions: [".js", ".jsx"],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: /node_modules/,
|
||||
use: ["babel-loader"],
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ["style-loader", "css-loader"],
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
||||
use: [
|
||||
{
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
outputPath: "images/",
|
||||
name: "[name].[ext]",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.less$/,
|
||||
use: [
|
||||
"style-loader",
|
||||
"css-loader",
|
||||
{
|
||||
loader: "less-loader",
|
||||
options: {
|
||||
plugins: [new LessPluginAutoPrefix({ browsers: ["last 3 versions"] })],
|
||||
javascriptEnabled: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
externals: [
|
||||
{
|
||||
lodash: "lodash",
|
||||
react: "react",
|
||||
"react-dom": "react-dom",
|
||||
},
|
||||
/^antd/i,
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user