rename production to release directory, rebuild assets

This commit is contained in:
Harshavardhana 2021-04-25 16:43:12 -07:00
parent f7feff8665
commit d825d92499
19 changed files with 86 additions and 76 deletions

1
.gitignore vendored
View file

@ -11,7 +11,6 @@ site/
**/access.log
vendor/**/*.js
vendor/**/*.json
release
.DS_Store
*.syso
coverage.txt

1
browser/.gitignore vendored
View file

@ -12,7 +12,6 @@ site/
build
vendor/**/*.js
vendor/**/*.json
release
.DS_Store
*.syso
coverage.txt

View file

@ -19,11 +19,13 @@ npm install
## Generating Assets
> NOTE: if you are not part of MinIO organization please do not run this yourself and submit in a PR. Static assets in PRs are allowed only for authorized users.
```sh
npm run release
```
This generates `production` in the current directory.
This generates `release` in the current directory.
## Run MinIO Browser with live reload
@ -166,4 +168,3 @@ npm run dev
```
Open [http://IP:8080/minio/](http://IP:8080/minio/) in your browser to play with the application.

View file

@ -17,6 +17,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
let delay = [0, 400]
function handleLoader(i) {
if (i < 2) {
setTimeout(function() {
document.querySelector(".page-load").classList.add("pl-" + i)
handleLoader(i + 1)
}, delay[i])
}
}
const hideLoader = () => handleLoader(0)
export default hideLoader

View file

@ -2,7 +2,7 @@ package browser
import "embed"
//go:embed production/*
//go:embed release/*
var fs embed.FS
// GetStaticAssets returns assets

View file

@ -39,7 +39,7 @@ rmDir = function(dirPath) {
async.waterfall([
function(cb) {
rmDir('production');
rmDir('release');
rmDir('dev');
var cmd = 'webpack -p --config webpack.production.config.js'
if (!isProduction) {

File diff suppressed because one or more lines are too long

View file

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View file

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

File diff suppressed because one or more lines are too long

View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View file

@ -25,12 +25,12 @@ var PurgecssPlugin = require('purgecss-webpack-plugin')
var exports = {
context: __dirname,
mode: 'production',
mode: 'release',
entry: [
path.resolve(__dirname, 'app/index.js')
],
output: {
path: path.resolve(__dirname, 'production'),
path: path.resolve(__dirname, 'release'),
filename: 'index_bundle.js'
},
module: {

View file

@ -47,7 +47,7 @@ func (h indexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.handler.ServeHTTP(w, r)
}
const assetPrefix = "production"
const assetPrefix = "release"
// specialAssets are files which are unique files not embedded inside index_bundle.js.
const specialAssets = "index_bundle.*.js|loader.css|logo.svg|firefox.png|safari.png|chrome.png|favicon-16x16.png|favicon-32x32.png|favicon-96x96.png"