-
Aleksandr Lesnenko authored
* add static viz build watch command * reload graalvm context each time in dev mode * run static viz with yarn:dev * address comments * use watch webpack env var Co-authored-by:
Noah Moss <noahbmoss@gmail.com>
Aleksandr Lesnenko authored* add static viz build watch command * reload graalvm context each time in dev mode * run static viz with yarn:dev * address comments * use watch webpack env var Co-authored-by:
Noah Moss <noahbmoss@gmail.com>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
webpack.static-viz.config.js 1.28 KiB
const SRC_PATH = __dirname + "/frontend/src/metabase";
const BUILD_PATH = __dirname + "/resources/frontend_client";
const CLJS_SRC_PATH = __dirname + "/frontend/src/cljs";
const LIB_SRC_PATH = __dirname + "/frontend/src/metabase-lib";
const BABEL_CONFIG = {
cacheDirectory: process.env.BABEL_DISABLE_CACHE ? null : ".babel_cache",
};
module.exports = env => {
const shouldDisableMinimization = env.WEBPACK_WATCH === true;
return {
mode: "production",
context: SRC_PATH,
performance: {
hints: false,
},
entry: {
"lib-static-viz": {
import: "./static-viz/index.js",
library: {
name: "StaticViz",
type: "var",
},
},
},
output: {
path: BUILD_PATH + "/app/dist",
filename: "[name].bundle.js",
},
module: {
rules: [
{
test: /\.(tsx?|jsx?)$/,
exclude: /node_modules|cljs/,
use: [{ loader: "babel-loader", options: BABEL_CONFIG }],
},
],
},
resolve: {
extensions: [".webpack.js", ".web.js", ".js", ".jsx", ".ts", ".tsx"],
alias: {
metabase: SRC_PATH,
cljs: CLJS_SRC_PATH,
"metabase-lib": LIB_SRC_PATH,
},
},
optimization: {
minimize: !shouldDisableMinimization,
},
};
};