redash/viz-lib/webpack.config.js
Gabriel Dutra fc246aafc4
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
2020-05-06 10:49:15 +03:00

66 lines
1.4 KiB
JavaScript

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,
],
};