const SRC_PATH = __dirname + "/frontend/src/metabase"; const BUILD_PATH = __dirname + "/resources/frontend_client"; const BABEL_CONFIG = { cacheDirectory: process.env.BABEL_DISABLE_CACHE ? null : ".babel_cache", }; module.exports = { mode: "production", context: SRC_PATH, 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: /\.(js|jsx)$/, exclude: /node_modules/, use: [{ loader: "babel-loader", options: BABEL_CONFIG }], }, { test: /\.(js|jsx)$/, exclude: /node_modules/, use: [ { loader: "eslint-loader", options: { rulePaths: [__dirname + "/frontend/lint/eslint-rules"], }, }, ], }, ], }, resolve: { extensions: [".webpack.js", ".web.js", ".js", ".jsx"], alias: { metabase: SRC_PATH, }, }, }