Skip to content
Snippets Groups Projects
Commit 53a297b1 authored by Chris Beer's avatar Chris Beer
Browse files

Use the init artifact as the dev entry point and restore state exports to the full UMD build

parent 49f4af63
Branches
No related tags found
No related merge requests found
import init from './init'; import init from './init';
import * as state from './state';
const exports = { const exports = {
viewer: init, ...init,
...state,
}; };
export default exports; export default exports;
...@@ -3,7 +3,7 @@ import MiradorViewer from './lib/MiradorViewer'; ...@@ -3,7 +3,7 @@ import MiradorViewer from './lib/MiradorViewer';
/** /**
* Default Mirador instantiation * Default Mirador instantiation
*/ */
export default function (config, pluginsOrStruct) { function viewer(config, pluginsOrStruct) {
let struct; let struct;
if (Array.isArray(pluginsOrStruct)) { if (Array.isArray(pluginsOrStruct)) {
...@@ -14,3 +14,9 @@ export default function (config, pluginsOrStruct) { ...@@ -14,3 +14,9 @@ export default function (config, pluginsOrStruct) {
return new MiradorViewer(config, struct); return new MiradorViewer(config, struct);
} }
const exports = {
viewer,
};
export default exports;
...@@ -61,7 +61,7 @@ module.exports = (env, options) => { ...@@ -61,7 +61,7 @@ module.exports = (env, options) => {
const config = baseConfig(options.mode); const config = baseConfig(options.mode);
if (isProduction) { if (isProduction) {
const prodConfig = { return {
...config, ...config,
devtool: 'source-map', devtool: 'source-map',
mode: 'production', mode: 'production',
...@@ -72,19 +72,6 @@ module.exports = (env, options) => { ...@@ -72,19 +72,6 @@ module.exports = (env, options) => {
}), }),
], ],
}; };
return [
prodConfig,
{
...prodConfig,
entry: ['./src/polyfills.js', './src/state/index.js'],
output: {
...prodConfig.output,
filename: 'mirador-state.min.js',
library: 'MiradorState',
},
},
];
} }
return { return {
...@@ -95,7 +82,7 @@ module.exports = (env, options) => { ...@@ -95,7 +82,7 @@ module.exports = (env, options) => {
port: 4444, port: 4444,
}, },
devtool: 'eval-source-map', devtool: 'eval-source-map',
entry: ['react-hot-loader/patch', ...config.entry], entry: ['react-hot-loader/patch', './src/polyfills.js', './src/init.js'],
mode: 'development', mode: 'development',
}; };
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment