FIX 更改build profuction的配置文件

This commit is contained in:
Jasder 2020-03-17 21:58:04 +08:00
parent 637ce0fc9a
commit 84bffef253
4 changed files with 6 additions and 6 deletions

View File

@ -76,7 +76,7 @@ function getClientEnvironment(publicUrl) {
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />. // For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
// This should only be used as an escape hatch. Normally you would put // 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. // 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 // Stringify all values so we can feed into Webpack DefinePlugin

View File

@ -83,7 +83,7 @@ module.exports = {
// cdn // cdn
// publicPath: 'https://shixun.educoder.net/react/build/', //publicPath, https://cdn.educoder.net // 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: '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) // Point sourcemap entries to original disk location (format as URL on Windows)
devtoolModuleFilenameTemplate: info => devtoolModuleFilenameTemplate: info =>

View File

@ -186,7 +186,7 @@ function generateNewIndexJsp() {
// combinedStream.append(htmlContent); // combinedStream.append(htmlContent);
// combinedStream.pipe(fs2.createWriteStream( filePath )); // combinedStream.pipe(fs2.createWriteStream( filePath ));
var outputPath = paths.appBuild + '/../../../index.html' var outputPath = paths.appBuild + '/index.html'
fs2.readFile(filePath, 'utf8', function (err,data) { fs2.readFile(filePath, 'utf8', function (err,data) {
if (err) { if (err) {
return console.log(err); return console.log(err);
@ -197,12 +197,12 @@ function generateNewIndexJsp() {
cdnHost = '' cdnHost = ''
var mainRegex = /<script type="text\/javascript" src="\/forgeplus-react\/build\/.\/static\/js\/main.([a-zA-Z0-9]{8,}).js"><\/script>/ var mainRegex = /<script type="text\/javascript" src="\/react\/build\/.\/static\/js\/main.([a-zA-Z0-9]{8,}).js"><\/script>/
var matchResult = data.match(mainRegex) var matchResult = data.match(mainRegex)
var code = ` var code = `
<script> <script>
(function() { (function() {
var _host = '/forgeplus-react/build/' var _host = '/react/build/'
/**/ /**/
if (window.location.host == 'pre-newweb.educoder.net') { if (window.location.host == 'pre-newweb.educoder.net') {
_host = 'https://testali-cdn.educoder.net/react/build/' _host = 'https://testali-cdn.educoder.net/react/build/'

View File

@ -486,7 +486,7 @@ class App extends Component {
oldLink = document.getElementById('dynamic-favicon'); oldLink = document.getElementById('dynamic-favicon');
link.id = 'dynamic-favicon'; link.id = 'dynamic-favicon';
link.rel = 'shortcut icon'; link.rel = 'shortcut icon';
link.href = "/forgeplus-react/build/./favicon.ico"; link.href = "/react/build/./favicon.ico";
if (oldLink) { if (oldLink) {
document.head.removeChild(oldLink); document.head.removeChild(oldLink);
} }