From 84bffef2539547d1006131dcb9a0634f0522a33c Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Tue, 17 Mar 2020 21:58:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?FIX=20=E6=9B=B4=E6=94=B9build=20profuction?= =?UTF-8?q?=E7=9A=84=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/env.js | 2 +- config/webpack.config.prod.js | 2 +- scripts/build.js | 6 +++--- src/App.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/env.js b/config/env.js index 905ee7d2b..ae1edea65 100644 --- a/config/env.js +++ b/config/env.js @@ -76,7 +76,7 @@ function getClientEnvironment(publicUrl) { // For example, . // This should only be used as an escape hatch. Normally you would put // images into the `src` and `import` them in code to get their paths. - PUBLIC_URL: '/forgeplus-react/build/.', + PUBLIC_URL: '/react/build/.', } ); // Stringify all values so we can feed into Webpack DefinePlugin diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 8e38b62f9..838ce28a8 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -83,7 +83,7 @@ module.exports = { // cdn // publicPath: 'https://shixun.educoder.net/react/build/', //publicPath, https://cdn.educoder.net // publicPath: 'https://cdn-testeduplus2.educoder.net/react/build/', //publicPath, https://cdn.educoder.net - publicPath: '/forgeplus-react/build/', //publicPath, https://cdn.educoder.net + publicPath: '/react/build/', //publicPath, https://cdn.educoder.net // Point sourcemap entries to original disk location (format as URL on Windows) devtoolModuleFilenameTemplate: info => diff --git a/scripts/build.js b/scripts/build.js index f5c692a7a..91b76133a 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -186,7 +186,7 @@ function generateNewIndexJsp() { // combinedStream.append(htmlContent); // combinedStream.pipe(fs2.createWriteStream( filePath )); - var outputPath = paths.appBuild + '/../../../index.html' + var outputPath = paths.appBuild + '/index.html' fs2.readFile(filePath, 'utf8', function (err,data) { if (err) { return console.log(err); @@ -197,12 +197,12 @@ function generateNewIndexJsp() { cdnHost = '' - var mainRegex = /