Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed demo content #125

Merged
merged 7 commits into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add .env config
  • Loading branch information
Dananji committed Feb 1, 2022
commit f2aa096b75cb7fad3ea90e14a4d9f2ef40bdbf4d
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PUBLIC_URL=/iiif-react-media-player
2 changes: 0 additions & 2 deletions docs/build/bundle.6b744cb1.js

This file was deleted.

2 changes: 2 additions & 0 deletions docs/build/bundle.d7348aad.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
</head>
<body>
<div id="rsg-root"></div>
<script src="build/bundle.6b744cb1.js"></script>
<script src="build/bundle.d7348aad.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/manifests/mahler-symphony-3.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": {
"id": "/iiif-react-media-player/manifests/mahler-symphony-3.json",
"type": "SpecificResource",
"source": "/manifests/mahler-symphony-3/canvas/2",
"source": "/iiif-react-media-player/manifests/mahler-symphony-3/canvas/2",
"selector": {
"type": "PointSelector",
"t": 120.5
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
],
"author": "Adam J. Arling",
"license": "ISC",
"homepage": ".",
"homepage": "https://samvera-labs.github.io/iiif-react-media-player/",
"devDependencies": {
"@babel/cli": "^7.11.6",
"@babel/core": "^7.11.6",
Expand All @@ -47,6 +47,7 @@
"babel-jest": "^26.3.0",
"babel-loader": "^8.1.0",
"css-loader": "^5.0.0",
"dotenv": "^14.3.0",
"html-webpack-plugin": "^5.5.0",
"jest": "^26.4.2",
"node-sass": "^5.0.0",
Expand All @@ -60,6 +61,7 @@
"rollup-plugin-cleaner": "^1.0.0",
"rollup-plugin-postcss": "^3.1.8",
"rollup-plugin-terser": "^7.0.1",
"rollup-plugin-webbundle": "^0.0.1",
"sass": "^1.28.0",
"sass-loader": "^10.0.5",
"style-loader": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion public/manifests/mahler-symphony-3.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": {
"id": "/iiif-react-media-player/manifests/mahler-symphony-3.json",
"type": "SpecificResource",
"source": "/manifests/mahler-symphony-3/canvas/2",
"source": "/iiif-react-media-player/manifests/mahler-symphony-3/canvas/2",
"selector": {
"type": "PointSelector",
"t": 120.5
Expand Down
40 changes: 34 additions & 6 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,38 @@ import replace from '@rollup/plugin-replace';
import alias from '@rollup/plugin-alias';
import postcss from 'rollup-plugin-postcss';
import baseUrl from 'rollup-plugin-base-url';
const webbundle = require('rollup-plugin-webbundle');
import pkg from './package.json';
import { terser } from 'rollup-plugin-terser';

const dotenv = require('dotenv');
const path = require('path');
const postcssSVG = require('postcss-svg');

const NODE_ENV = 'production';
const projectRootDir = path.resolve(__dirname);

// Get the root path (assuming your webpack config is in the root of your project!)
const currentPath = path.join(__dirname);

// Create the fallback path (the production .env)
const basePath = currentPath + '/.env';

// We're concatenating the environment name to our filename to specify the correct env file!
const envPath = basePath + '.' + env.ENVIRONMENT;

// Check if the file exists, otherwise fall back to the production .env
const finalPath = fs.existsSync(envPath) ? envPath : basePath;

// Set the path parameter in the dotenv config
const fileEnv = dotenv.config({ path: finalPath }).parsed;

// reduce it to a nice object, the same as before (but with the variables from the file)
const envKeys = Object.keys(fileEnv).reduce((prev, next) => {
prev[`process.env.${next}`] = JSON.stringify(fileEnv[next]);
return prev;
}, {});

let productionRollup = {
input: 'src/main.js',
output: [
Expand Down Expand Up @@ -57,15 +80,20 @@ let productionRollup = {
},
],
}),
url({
include: ['**/*.mp4', '**/*.vtt', '**/*.docx', '**/*.txt', '**/*.json'],
limit: Infinity,
publicPath: '/public',
}),
// url({
// include: ['**/*.mp4', '**/*.vtt', '**/*.docx', '**/*.txt', '**/*.json'],
// limit: Infinity,
// publicPath: '/iiif-react-media-player',
// }),
// baseUrl({
// url: '/iiif-react-media-player', // the base URL prefix; optional, defaults to /
// staticImports: true, // also rebases static `import _ from "…"`; optional, defaults to false
// // staticImports: true, // also rebases static `import _ from "…"`; optional, defaults to false
// }),
// webbundle({
// baseURL: 'https://samvera-labs.github.io/iiif-react-media-player/',
// static: { dir: 'static' },
// }),
// new webpack.DefinePlugin(envKeys),
babel({
babelHelpers: 'runtime',
babelrc: true,
Expand Down
Loading