From 9671aff597fc64c3ad8fc5abaabadb085bae0e08 Mon Sep 17 00:00:00 2001 From: Jack Reed <phillipjreed@gmail.com> Date: Wed, 22 Aug 2018 12:43:40 -0600 Subject: [PATCH] move index.umd.js -> m3core.umd.js --- .eslintignore | 2 +- .gitignore | 2 +- README.md | 4 ++-- __tests__/integration/vanilla-js/index.html | 2 +- src/components/App.js | 2 +- src/components/ManifestForm.js | 2 +- src/index.js | 2 +- index.js => src/store.js | 4 ++-- webpack.config.js | 8 +++++--- 9 files changed, 15 insertions(+), 13 deletions(-) rename index.js => src/store.js (87%) diff --git a/.eslintignore b/.eslintignore index 031fe61c8..8f8e2ae87 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 0c02c19b1..766d3c6ab 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 3496b9991..3ae170d69 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 608965435..5c0485d46 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 89985d207..426a43de3 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 f26f6dca1..ab5b49f61 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 e4129d8f1..4bf15d7ff 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 58282e601..0f3fd1902 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 5e4f82f24..454b9d1fd 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', }, -- GitLab