diff --git a/.eslintignore b/.eslintignore index 031fe61c88f536a8d8bbf442c3be76d7d348c214..8f8e2ae87f8bca30d3d5f9f89d8e7468f052ce1a 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,2 @@ -index.umd.js +m3core.umd.js mirador.min.js diff --git a/.gitignore b/.gitignore index 0c02c19b10d249be4f90321b5dd89145a04dd642..766d3c6abb5fcd5171c7a1402193219affce15c4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -index.umd.js +m3core.umd.js dist/mirador.min.js diff --git a/README.md b/README.md index 3496b9991816681894dde9b7f119afafd5dc5a7a..3ae170d692ac18237267ce5b082608099e312656 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This module is intended to be a console-only version of the a Mirador-like viewe To run the module, first make sure you are in this directory (`minimal_redux_poc`), then: 1. Run `npm install` to install the dependencies. -1. Run the `npm run build:umd` task. This will produce an "isomorphic" webpack bundle of the module that can run in the console or browser. The bundle will be called `index.umd.js` and is placed in this same directory. +1. Run the `npm run build:umd` task. This will produce an "isomorphic" webpack bundle of the module that can run in the console or browser. The bundle will be called `m3core.umd.js` and is placed in the `dist` directory. 1. Open a nodejs console (type `node`) in this directory. 1. Import variable names from the module, for example, `let { store, actions } = require('./index.umd')`. 1. The exported module currently has most of its functionality under the "store" property, so you may prefer to include it with `let state = require('./index.umd').store`. @@ -50,4 +50,4 @@ $ npm run lint ### Redux DevTools -This is a web browser extension for debugging Redux applications. See https://github.com/zalmoxisus/redux-devtools-extension for installation and usage instructions. \ No newline at end of file +This is a web browser extension for debugging Redux applications. See https://github.com/zalmoxisus/redux-devtools-extension for installation and usage instructions. diff --git a/__tests__/integration/vanilla-js/index.html b/__tests__/integration/vanilla-js/index.html index 6089654357252f0e9d89cdff70489e4ee6d8a4e7..5c0485d46fb67960cd4e2a80e14d72668591aa8c 100644 --- a/__tests__/integration/vanilla-js/index.html +++ b/__tests__/integration/vanilla-js/index.html @@ -3,7 +3,7 @@ <head> <meta charset="UTF-8"> <title>Examples</title> - <script src="../../../index.umd.js"></script> + <script src="../../../dist/m3core.umd.js"></script> </head> <body> diff --git a/src/components/App.js b/src/components/App.js index 89985d2074be52e3c77f382b1dd6d6e020f58402..426a43de33b650c11d4838961bdedc3566b348a4 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; -import { actions } from '../../index'; +import { actions } from '../store'; import Display from './Display'; import ManifestForm from './ManifestForm'; diff --git a/src/components/ManifestForm.js b/src/components/ManifestForm.js index f26f6dca17e80dca63562e16f772b16e240954cc..ab5b49f6161d05bf7d41a70e0e94172ba163f98e 100644 --- a/src/components/ManifestForm.js +++ b/src/components/ManifestForm.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; -import { actions } from '../../index'; +import { actions } from '../store'; class ManifestForm extends Component { constructor(props) { diff --git a/src/index.js b/src/index.js index e4129d8f1b8cc9454b6b09d24d7dc5735f476307..4bf15d7ffb389bb78dba3a2b1cb4602a012fd7a2 100644 --- a/src/index.js +++ b/src/index.js @@ -2,7 +2,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import App from './components/App'; -import { store } from '../index'; +import { store } from './store'; import './styles/index.scss'; ReactDOM.render( diff --git a/index.js b/src/store.js similarity index 87% rename from index.js rename to src/store.js index 58282e601dac6c8e26e10737c6c34d6a2c63d748..0f3fd1902363cafcec06446c1ebd68b24db3c232 100644 --- a/index.js +++ b/src/store.js @@ -7,8 +7,8 @@ import thunkMiddleware from 'redux-thunk'; import { createLogger } from 'redux-logger'; import { createStore, applyMiddleware } from 'redux'; import { composeWithDevTools } from 'redux-devtools-extension'; -import rootReducer from './src/reducers/index'; -import * as ActionCreators from './src/actions'; +import rootReducer from './reducers/index'; +import * as ActionCreators from './actions'; const loggerMiddleware = createLogger(); // Create a Redux store holding the state of your app. diff --git a/webpack.config.js b/webpack.config.js index 5e4f82f242a2e3ba9e5dacf62d66ddecd3e83244..454b9d1fde1ddc96a3e6d170408ef5a838800cc0 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,9 +1,11 @@ +const path = require('path'); + module.exports = [ { - entry: './index.js', + entry: './src/store.js', output: { - path: __dirname, - filename: 'index.umd.js', + path: path.join(__dirname, 'dist'), + filename: 'm3core.umd.js', libraryTarget: 'umd', library: 'm3core', },