From 7f7112a4eabedf591f1c56efc6d8222bec19b9d5 Mon Sep 17 00:00:00 2001 From: senwii Date: Tue, 10 Mar 2020 05:27:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.tsx | 4 ++-- src/router.ts | 6 ------ webpack.config.js | 4 ---- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 1ba02e6..5181fc2 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -6,12 +6,12 @@ import { Route, } from "react-router-dom" -import routes, { basename } from './router' +import routes from './router' function App() { return (
- + { routes.map((route:any, index) => ( diff --git a/src/router.ts b/src/router.ts index bc8c444..cb1a971 100644 --- a/src/router.ts +++ b/src/router.ts @@ -11,10 +11,4 @@ const routes = [ }, ] -const basename = `/${process.env.PROJECT_NAME}/` - -export { - basename, -} - export default routes diff --git a/webpack.config.js b/webpack.config.js index 475c27a..672b475 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,5 @@ const webpack = require('webpack') const appDirName = process.cwd() -const packageName = require(`${appDirName}/package.json`).name const MiniCssExtractPlugin = require('mini-css-extract-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin') const CopyWebpackPlugin = require('copy-webpack-plugin') @@ -33,9 +32,6 @@ const plugins = [ flatten: true, }, ]), - new webpack.DefinePlugin({ - 'process.env.PROJECT_NAME': JSON.stringify(packageName), - }), ] if (IS_PRODUCTION) {