一、安装python环境
安装 python 一定要看superset 支持的python版本
另外环境变量的设置,这个就不特地说明,请百度
二、pip安装相关库
在安装的过程中比较容易出现whl库缺少的问题
可到https://www.lfd.uci.edu/~gohlke/pythonlibs/上查找到对应的库文件手动下载,通过pip install XXX 手动安装
三、安装前端环境 node
四、编译前端静态文件
编译静态文件时,需要npm install
npm install 的时候要记得用成国内镜像服务,
相对来说会快点,事实我这边ping 域名,以我自己本地网络才说,国内镜像是官方的4倍
最新superset有一个比较严重的问题
就是在jsx文件编译不过
我通过旧版本对比发现
旧版本中存在.babelrc 文件
但是最新版本不存在
解决方案:
代码片段
/* eslint-disable no-console */
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const parsedArgs = require('yargs').argv;
const getProxyConfig = require('./webpack.proxy-config');
const packageConfig = require('./package.json');
// input dir
const AP