From a212863bf3a7ab0c1af684a0ce63ea150ab6507f Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Tue, 1 May 2018 00:05:04 -0400 Subject: [PATCH] Wiring up React Router routing and condensing entry points into SPA --- application.py | 10 +-- blueprints/editor.py | 8 --- blueprints/joyce.py | 11 +++ blueprints/notes.py | 8 --- blueprints/reader.py | 11 --- blueprints/search.py | 8 --- src/components/button.js | 4 +- src/components/list.js | 8 +-- src/components/navbar.js | 19 +++-- src/containers/joyceEditorPageContainer.js | 38 ++++------ src/containers/joyceEditorSidebarContainer.js | 4 +- src/containers/joyceReaderPageContainer.js | 43 +++++------ src/containers/joyceReaderSidebarContainer.js | 2 +- src/containers/navbar.js | 25 +++++++ src/editor.js | 42 ----------- src/joyce.js | 71 +++++++++++++++++++ src/middleware/joyceAPI.js | 34 +++++---- src/notes.js | 39 ---------- src/reader.js | 42 ----------- src/reducers/docType.js | 5 ++ src/reducers/reduceEditor.js | 27 ------- src/reducers/reduceReader.js | 7 +- src/stylesheets/{editor.scss => joyce.scss} | 0 src/stylesheets/reader.scss | 22 ------ templates/editor.html | 14 ---- templates/{reader.html => joyce.html} | 2 +- templates/notes.html | 15 ---- templates/search.html | 14 ---- webpack.common.js | 31 +++----- 29 files changed, 206 insertions(+), 358 deletions(-) delete mode 100644 blueprints/editor.py create mode 100644 blueprints/joyce.py delete mode 100644 blueprints/notes.py delete mode 100644 blueprints/reader.py delete mode 100644 blueprints/search.py create mode 100644 src/containers/navbar.js delete mode 100644 src/editor.js create mode 100644 src/joyce.js delete mode 100644 src/notes.js delete mode 100644 src/reader.js delete mode 100644 src/reducers/reduceEditor.js rename src/stylesheets/{editor.scss => joyce.scss} (100%) delete mode 100644 src/stylesheets/reader.scss delete mode 100644 templates/editor.html rename templates/{reader.html => joyce.html} (86%) delete mode 100644 templates/notes.html delete mode 100644 templates/search.html diff --git a/application.py b/application.py index 6e20ef2..d54d167 100644 --- a/application.py +++ b/application.py @@ -2,10 +2,7 @@ from flask import Flask from flask_webpack import Webpack from werkzeug.serving import run_simple -from blueprints.reader import reader -from blueprints.notes import notes -from blueprints.editor import editor -from blueprints.search import search +from blueprints.joyce import joyce from blueprints.api import api # Initialize application @@ -25,11 +22,8 @@ webpack = Webpack() webpack.init_app(application) # Register blueprints -application.register_blueprint(reader) -application.register_blueprint(editor, url_prefix='/edit') +application.register_blueprint(joyce) application.register_blueprint(api, url_prefix='/api') -application.register_blueprint(search, url_prefix='/search') -application.register_blueprint(notes, url_prefix='/notes') if __name__ == "__main__": # application.debug=True diff --git a/blueprints/editor.py b/blueprints/editor.py deleted file mode 100644 index d6c6631..0000000 --- a/blueprints/editor.py +++ /dev/null @@ -1,8 +0,0 @@ -from flask import Blueprint, render_template, abort -from jinja2 import TemplateNotFound - -editor = Blueprint('editor', __name__) - -@editor.route('/') -def show_reader(): - return render_template('editor.html') \ No newline at end of file diff --git a/blueprints/joyce.py b/blueprints/joyce.py new file mode 100644 index 0000000..8b09b31 --- /dev/null +++ b/blueprints/joyce.py @@ -0,0 +1,11 @@ +from flask import Blueprint, render_template, abort, redirect +from jinja2 import TemplateNotFound + +joyce = Blueprint('joyce', __name__) + +@joyce.route('/', defaults={'path': ''}) +def redirect_root(path): + return redirect('/1') +@joyce.route('/') +def show_joyce(path): + return render_template('joyce.html') \ No newline at end of file diff --git a/blueprints/notes.py b/blueprints/notes.py deleted file mode 100644 index c63fadb..0000000 --- a/blueprints/notes.py +++ /dev/null @@ -1,8 +0,0 @@ -from flask import Blueprint, render_template, abort -from jinja2 import TemplateNotFound - -notes = Blueprint('notes', __name__) - -@notes.route('/') -def show_reader(): - return render_template('notes.html') \ No newline at end of file diff --git a/blueprints/reader.py b/blueprints/reader.py deleted file mode 100644 index 42ec74f..0000000 --- a/blueprints/reader.py +++ /dev/null @@ -1,11 +0,0 @@ -from flask import Blueprint, render_template, abort, redirect -from jinja2 import TemplateNotFound - -reader = Blueprint('reader', __name__) - -@reader.route('/', defaults={'path': ''}) -def redirect_root(path): - return redirect('/1') -@reader.route('/') -def show_reader(path): - return render_template('reader.html') \ No newline at end of file diff --git a/blueprints/search.py b/blueprints/search.py deleted file mode 100644 index 71bd4cd..0000000 --- a/blueprints/search.py +++ /dev/null @@ -1,8 +0,0 @@ -from flask import Blueprint, render_template, abort -from jinja2 import TemplateNotFound - -search = Blueprint('search', __name__) - -@search.route('/') -def show_search(): - return render_template('search.html') \ No newline at end of file diff --git a/src/components/button.js b/src/components/button.js index 1abaa93..6eb3a33 100644 --- a/src/components/button.js +++ b/src/components/button.js @@ -19,9 +19,9 @@ export const ReaderAnnotateButton = ({onClick}) => -export const ChapterButton = ({chapter, currentChapter, onClick}) => +export const ChapterButton = ({chapter, currentChapter, path}) =>
- + {romanize(chapter.number)}. {chapter.title}
diff --git a/src/components/list.js b/src/components/list.js index ef7c9a1..6a838e8 100644 --- a/src/components/list.js +++ b/src/components/list.js @@ -1,20 +1,20 @@ import React from 'react' import { ChapterButton, NoteButton } from './button' -export const DocumentList = ({notes, chapters, currentDocument, onDocumentClick, docType}) => +export const DocumentList = ({notes, chapters, currentDocument, onDocumentClick, path, docType}) =>
{(docType === 'chapters' && chapters.length > 0) && - + } {(docType === 'notes' && notes.length > 0) && }
-export const ChapterList = ({chapters, currentChapter, onChapterClick}) => +export const ChapterList = ({chapters, currentChapter, path}) =>
{chapters.map(chapter => - onChapterClick(chapter.id, 'chapters')}/> + )}
diff --git a/src/components/navbar.js b/src/components/navbar.js index 97aef9d..f72f454 100644 --- a/src/components/navbar.js +++ b/src/components/navbar.js @@ -1,6 +1,9 @@ import React from 'react' + import { Link } from 'react-router-dom' -const Navbar = () => + import { connect } from 'react-redux' + +const Navbar = ({currentDocument}) => -const string = "
  • Search
  • About
  • " +const mapStateToProps = state => { + return { + currentDocument: state.currentDocument, + } +} + +const JoyceReaderPageContainer = connect(mapStateToProps)(JoyceReaderPage) export default Navbar \ No newline at end of file diff --git a/src/containers/joyceEditorPageContainer.js b/src/containers/joyceEditorPageContainer.js index 36d12c2..e335dfa 100644 --- a/src/containers/joyceEditorPageContainer.js +++ b/src/containers/joyceEditorPageContainer.js @@ -3,38 +3,28 @@ import { connect } from 'react-redux' import { EditorState } from 'draft-js' import { deleteCurrentDocument, submitAnnotation, selectAnnotationNote } from '../actions/userActions' -import Navbar from '../components/navbar' import Content from '../components/content' -import DeleteConfirmModal from '../components/deleteConfirmModal' -import AnnotateModal from '../components/annotateModal' -import AnnotationModal from '../components/annotationModal' import { EditorWelcome } from '../components/welcome' import LoadingSpinner from '../components/loadingSpinner' import JoyceEditorSidebarContainer from '../containers/joyceEditorSidebarContainer' import JoyceEditorContentContainer from '../containers/joyceEditorContentContainer' const JoyceEditorPage = ({notes, currentDocument, docType, annotationNote, onDeleteClick, onSubmitAnnotationClick, selectAnnotationNote, selectionState, editorState, loadingToggle}) => -
    - -
    -
    - - - {loadingToggle === true && - - } - {(Object.keys(currentDocument).length > 0 && loadingToggle === false) && - - } - {(Object.keys(currentDocument).length === 0 && loadingToggle === false) && - - } - -
    +
    +
    + + + {loadingToggle === true && + + } + {(Object.keys(currentDocument).length > 0 && loadingToggle === false) && + + } + {(Object.keys(currentDocument).length === 0 && loadingToggle === false) && + + } +
    - onDeleteClick(currentDocument.id, docType)}/> - onSubmitAnnotationClick(annotationNote, selectionState, editorState)} selectAnnotationNote={selectAnnotationNote} /> -
    const mapStateToProps = state => { diff --git a/src/containers/joyceEditorSidebarContainer.js b/src/containers/joyceEditorSidebarContainer.js index cae4cca..b1da203 100644 --- a/src/containers/joyceEditorSidebarContainer.js +++ b/src/containers/joyceEditorSidebarContainer.js @@ -13,7 +13,7 @@ const JoyceEditorSidebar = ({notes, chapters, docType, currentDocument, onDocume onNewDocumentClick(docType)} docType={docType}/> - +
    @@ -22,7 +22,7 @@ const mapStateToProps = state => { notes: state.notes, chapters: state.chapters, docType: state.docType, - currentDocument: state.currentDocument + currentDocument: state.currentDocument, } } diff --git a/src/containers/joyceReaderPageContainer.js b/src/containers/joyceReaderPageContainer.js index 4562027..9fba8cf 100644 --- a/src/containers/joyceReaderPageContainer.js +++ b/src/containers/joyceReaderPageContainer.js @@ -1,44 +1,35 @@ import React from 'react' import { connect } from 'react-redux' -import { Route } from 'react-router' +import { EditorState } from 'draft-js' -import Navbar from '../components/navbar' import Content from '../components/content' -import AnnotationModal from '../components/annotationModal' import { ReaderWelcome } from '../components/welcome' import LoadingSpinner from '../components/loadingSpinner' import JoyceReaderSidebarContainer from '../containers/joyceReaderSidebarContainer' import JoyceReaderContentContainer from '../containers/joyceReaderContentContainer' -const JoyceReaderPage = ({currentDocument, loadingToggle, annotationNote}) => -
    - -
    - -
    - - - {loadingToggle === true && - - } - {(Object.keys(currentDocument).length > 0 && loadingToggle === false) && - - } - {(Object.keys(currentDocument).length === 0 && loadingToggle === false) && - - } - -
    -
    +const JoyceReaderPage = ({currentDocument, loadingToggle}) => +
    +
    + + + {loadingToggle === true && + + } + {(Object.keys(currentDocument).length > 0 && loadingToggle === false) && + + } + {(Object.keys(currentDocument).length === 0 && loadingToggle === false) && + + } +
    -
    const mapStateToProps = state => { return { - loadingToggle: state.loadingToggle, currentDocument: state.currentDocument, - annotationNote: state.annotationNote + loadingToggle: state.loadingToggle } } diff --git a/src/containers/joyceReaderSidebarContainer.js b/src/containers/joyceReaderSidebarContainer.js index 5f13f01..7b76ecb 100644 --- a/src/containers/joyceReaderSidebarContainer.js +++ b/src/containers/joyceReaderSidebarContainer.js @@ -10,7 +10,7 @@ const JoyceReaderSidebar = ({chapters, notes, currentDocument, onDocumentClick,
    - +
    diff --git a/src/containers/navbar.js b/src/containers/navbar.js new file mode 100644 index 0000000..ea6d136 --- /dev/null +++ b/src/containers/navbar.js @@ -0,0 +1,25 @@ + import React from 'react' + import { Link } from 'react-router-dom' + +const Navbar = () => + + +export default Navbar \ No newline at end of file diff --git a/src/editor.js b/src/editor.js deleted file mode 100644 index d980c5e..0000000 --- a/src/editor.js +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react' -import ReactDOM from 'react-dom' -import { createStore, applyMiddleware } from 'redux' -import { Provider } from 'react-redux' -import 'bootstrap' - -import reduceEditor from './reducers/reduceEditor' -import { getDocumentList } from './actions/apiActions' -import { setCurrentDocument, setDocType } from './actions/userActions' -import { joyceAPI, logger } from './middleware/' -import { getFirstDocument } from './mixins/firstDocument' -import JoyceEditorPageContainer from './containers/joyceEditorPageContainer' - -const docType = 'chapters' -const store = createStore(reduceEditor, applyMiddleware(joyceAPI, logger)) -store.dispatch(setDocType(docType)) - -ReactDOM.render( - - - , - document.getElementById('wrapper') -) - -store.dispatch(getDocumentList({docType: 'notes'})) -store.dispatch(getDocumentList({ - docType: docType, - state: 'currentDocType' -})) - -// TODO: Remove when -// API can handle number lookups -// Routing can handle / => /1 -setTimeout( - () => { - const firstDocument = getFirstDocument(store, docType) - if (firstDocument) { - store.dispatch(setCurrentDocument(firstDocument.id, docType)) - } - }, - 1000 -) \ No newline at end of file diff --git a/src/joyce.js b/src/joyce.js new file mode 100644 index 0000000..fb2c80f --- /dev/null +++ b/src/joyce.js @@ -0,0 +1,71 @@ +// node_modules +import React from 'react' +import ReactDOM from 'react-dom' +import { createStore, applyMiddleware } from 'redux' +import { Provider } from 'react-redux' +import { Route, Redirect } from 'react-router' +import { ConnectedRouter, routerReducer, routerMiddleware, push } from 'react-router-redux' +import createHistory from 'history/createBrowserHistory' +import 'bootstrap' + +// src packages +import Navbar from './containers/navbar' +import reduceReader from './reducers/reduceReader' +import { selectAnnotationNote } from './actions/userActions' +import { getDocumentList } from './actions/apiActions' +import DeleteConfirmModal from './components/deleteConfirmModal' +import AnnotateModal from './components/annotateModal' +import AnnotationModal from './components/annotationModal' +import { setCurrentDocument, setDocType } from './actions/userActions' +import { logger, joyceAPI } from './middleware/' +import { getFirstDocument } from './mixins/firstDocument' +import JoyceReaderPageContainer from './containers/joyceReaderPageContainer' +import JoyceEditorPageContainer from './containers/joyceEditorPageContainer' + +// TODO: Pass routing from Flask? + +const history = createHistory() +const router = routerMiddleware(history) + +const docType = 'chapters' +const store = createStore(reduceReader, applyMiddleware(logger, joyceAPI, router)) +store.dispatch(setDocType(docType)) + +ReactDOM.render( + + +
    + + { + const currentDocument = store.getState().currentDocument + if (store.getState().docType === 'chapters') { + if (currentDocument.id) { + return + } else { + return + } + } + }}/> + { + if (store.getState().notes[0]) { + return + } + return + }}/> + + + + onDeleteClick(currentDocument.id, docType)}/> + onSubmitAnnotationClick(store.getState().annotationNote, store.getState().selectionState, store.getState().editorState)} selectAnnotationNote={selectAnnotationNote} /> + +
    +
    +
    , + document.getElementById('wrapper') +) + +store.dispatch(getDocumentList({ + docType: docType, + state: 'initialPageLoad' +})) +store.dispatch(getDocumentList({docType: 'notes'})) \ No newline at end of file diff --git a/src/middleware/joyceAPI.js b/src/middleware/joyceAPI.js index 2685b6a..1c1ebf3 100644 --- a/src/middleware/joyceAPI.js +++ b/src/middleware/joyceAPI.js @@ -58,10 +58,17 @@ const selectChapterIDByNumber = (store, number) => { } const parseNumberFromPath = path => { - const match = /^\/([0-9]*)/.exec(path) - const number = Number(match[1]) - console.log('Hey!', number) - return number + const match = /\/([0-9]*)$/.exec(path) + if (match) { + if (parseInt(match[1])) { + const number = Number(match[1]) + return number + } else { + return null + } + } else { + return null + } } // API Middleware @@ -75,12 +82,14 @@ export const joyceAPI = store => next => action => { store.dispatch(getDocumentList(response)) ) } - if (action.status === 'success' && action.state === 'initialPageLoad') { - HTTPGetDocumentList(action.docType, action.state).then(response => { - const pathName = store.getState().routerReducer.location.pathname - store.dispatch(setCurrentDocument(selectChapterIDByNumber(store, parseNumberFromPath(pathName)), action.docType)) - }) - } + if (action.status === 'success' && action.docType === store.getState().docType && !store.getState().currentDocument.id) { + if (action.docType === 'chapters') { + const pathNumber = parseNumberFromPath(store.getState().routerReducer.location.pathname) + store.dispatch(setCurrentDocument(selectChapterIDByNumber(store, pathNumber), action.docType)) + } else if (action.docType === 'notes') { + store.dispatch(setCurrentDocument(store.getState().notes[0].id, action.docType)) + } + } break case 'GET_DOCUMENT_TEXT': if (action.status === 'request') { @@ -167,9 +176,10 @@ export const joyceAPI = store => next => action => { } break case '@@router/LOCATION_CHANGE': - if (/^\/[0-9]*/.test(action.payload.pathname)) { + const pathNumber = parseNumberFromPath(action.payload.pathname) + if (pathNumber) { for (const chapter of store.getState().chapters) { - if (action.payload.pathname === '/' + chapter.number) { + if (pathNumber === chapter.number) { store.dispatch(setCurrentDocument(chapter.id, 'chapters')) } } diff --git a/src/notes.js b/src/notes.js deleted file mode 100644 index 72f39e6..0000000 --- a/src/notes.js +++ /dev/null @@ -1,39 +0,0 @@ -import React from 'react' -import ReactDOM from 'react-dom' -import { createStore, applyMiddleware } from 'redux' -import { Provider } from 'react-redux' -import 'bootstrap' - -import reduceReader from './reducers/reduceReader' -import { getDocumentList } from './actions/apiActions' -import { setCurrentDocument, setDocType } from './actions/userActions' -import { logger, joyceAPI } from './middleware/' -import { getFirstDocument } from './mixins/firstDocument' -import JoyceReaderPageContainer from './containers/joyceReaderPageContainer' - -// TODO: Pass routing from Flask? - -let docType = 'notes' -let store = createStore(reduceReader, applyMiddleware(logger, joyceAPI)) -store.dispatch(setDocType(docType)) - -ReactDOM.render( - - - , - document.getElementById('wrapper') -) - -store.dispatch(getDocumentList({docType: docType})) - -// Hacky way to fetch first chapter after async call above has completed. -// TODO: Add number lookup to API? -setTimeout( - () => { - const firstDocument = getFirstDocument(store, docType) - if (firstDocument) { - store.dispatch(setCurrentDocument(firstDocument.id, docType)) - } - }, - 1000 -) \ No newline at end of file diff --git a/src/reader.js b/src/reader.js deleted file mode 100644 index 163ba4c..0000000 --- a/src/reader.js +++ /dev/null @@ -1,42 +0,0 @@ -// node_modules -import React from 'react' -import ReactDOM from 'react-dom' -import { createStore, applyMiddleware } from 'redux' -import { Provider } from 'react-redux' -import { ConnectedRouter, routerReducer, routerMiddleware, push } from 'react-router-redux' -import createHistory from 'history/createBrowserHistory' -// import 'bootstrap' - -// src packages -import reduceReader from './reducers/reduceReader' -import { getDocumentList } from './actions/apiActions' -import { setCurrentDocument, setDocType } from './actions/userActions' -import { logger, joyceAPI } from './middleware/' -import { getFirstDocument } from './mixins/firstDocument' -import JoyceReaderPageContainer from './containers/joyceReaderPageContainer' -import JoyceEditorPageContainer from './containers/joyceEditorPageContainer' - -// TODO: Pass routing from Flask? - -const history = createHistory() -const router = routerMiddleware(history) - -const docType = 'chapters' -const store = createStore(reduceReader, applyMiddleware(logger, joyceAPI, router)) -store.dispatch(setDocType(docType)) - -ReactDOM.render( - - -
    - -
    -
    -
    , - document.getElementById('wrapper') -) - -store.dispatch(getDocumentList({ - docType: docType, - state: 'initialPageLoad' -})) \ No newline at end of file diff --git a/src/reducers/docType.js b/src/reducers/docType.js index fe8f742..d67cb59 100644 --- a/src/reducers/docType.js +++ b/src/reducers/docType.js @@ -2,6 +2,11 @@ const docType = (state=null, action) => { switch(action.type) { case 'SET_DOC_TYPE': return action.docType + case '@@router/LOCATION_CHANGE': + const path = action.payload.pathname + if (/^\/(notes).*/.exec(path)) { + return 'notes' + } else { return state } default: return state } diff --git a/src/reducers/reduceEditor.js b/src/reducers/reduceEditor.js deleted file mode 100644 index 719772f..0000000 --- a/src/reducers/reduceEditor.js +++ /dev/null @@ -1,27 +0,0 @@ -import { combineReducers } from 'redux' - -import notes from './notes' -import chapters from './chapters' -import currentDocument from './currentDocument' -import docType from './docType' -import mode from './mode' -import documentTitleInput from './documentTitleInput' -import editorState from './editorState' -import selectionState from './selectionState' -import annotationNote from './annotationNote' -import loadingToggle from './loadingToggle' - -const reduceDocuments = combineReducers({ - notes, - chapters, - currentDocument, - annotationNote, - mode, - documentTitleInput, - editorState, - docType, - selectionState, - loadingToggle -}) - -export default reduceDocuments \ No newline at end of file diff --git a/src/reducers/reduceReader.js b/src/reducers/reduceReader.js index 95baaeb..df6b295 100644 --- a/src/reducers/reduceReader.js +++ b/src/reducers/reduceReader.js @@ -9,7 +9,8 @@ import highlightToggle from './highlightToggle' import loadingToggle from './loadingToggle' import docType from './docType' import { routerReducer } from 'react-router-redux' - +import mode from './mode' +import documentTitleInput from './documentTitleInput' const reduceReader = combineReducers({ chapters, @@ -20,7 +21,9 @@ const reduceReader = combineReducers({ currentDocument, highlightToggle, loadingToggle, - routerReducer + routerReducer, + mode, + documentTitleInput }) export default reduceReader \ No newline at end of file diff --git a/src/stylesheets/editor.scss b/src/stylesheets/joyce.scss similarity index 100% rename from src/stylesheets/editor.scss rename to src/stylesheets/joyce.scss diff --git a/src/stylesheets/reader.scss b/src/stylesheets/reader.scss deleted file mode 100644 index 1d6660b..0000000 --- a/src/stylesheets/reader.scss +++ /dev/null @@ -1,22 +0,0 @@ -@import "variables"; -@import "window"; -@import "navbar"; -@import "sidebar"; -@import "page"; -@import "node_modules/bootstrap/scss/bootstrap"; - -$fa-font-path: "../../node_modules/font-awesome/fonts"; -@import "node_modules/font-awesome/scss/font-awesome"; - -#joyce_reader { - overflow: hidden; - width: 95%; - height: 100%; - background-color: rgba(256,256,256,0.5); - border-left: 1px solid $border_color; - border-right: 1px solid $border_color; -} - -#joyce_reader > div { - margin-top: 0.5em; -} diff --git a/templates/editor.html b/templates/editor.html deleted file mode 100644 index e990676..0000000 --- a/templates/editor.html +++ /dev/null @@ -1,14 +0,0 @@ - - - Joyce - Editor - - - - - - -
    -
    - - - \ No newline at end of file diff --git a/templates/reader.html b/templates/joyce.html similarity index 86% rename from templates/reader.html rename to templates/joyce.html index b6a3ec2..e902d82 100644 --- a/templates/reader.html +++ b/templates/joyce.html @@ -11,5 +11,5 @@
    - + \ No newline at end of file diff --git a/templates/notes.html b/templates/notes.html deleted file mode 100644 index 39cb3e4..0000000 --- a/templates/notes.html +++ /dev/null @@ -1,15 +0,0 @@ - - - Joyce - Notes - - - - - - - -
    -
    - - - \ No newline at end of file diff --git a/templates/search.html b/templates/search.html deleted file mode 100644 index 55aad5e..0000000 --- a/templates/search.html +++ /dev/null @@ -1,14 +0,0 @@ - - - Joyce - Search - - - - - - -
    -
    - - - \ No newline at end of file diff --git a/webpack.common.js b/webpack.common.js index 7a3a53c..dde9022 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -7,21 +7,9 @@ const rootAssetPath = './src/' module.exports = { entry: { - reader: [ - rootAssetPath + 'reader', - rootAssetPath + 'stylesheets/' + 'reader.scss' - ], - editor: [ - rootAssetPath + 'editor', - rootAssetPath + 'stylesheets/' + 'editor.scss' - ], - notes: [ - rootAssetPath + 'notes', - rootAssetPath + 'stylesheets/' + 'reader.scss' - ], - search: [ - rootAssetPath + 'search', - rootAssetPath + 'stylesheets/' + 'search.scss' + joyce: [ + rootAssetPath + 'joyce', + rootAssetPath + 'stylesheets/' + 'joyce.scss' ] }, module : { @@ -78,11 +66,12 @@ module.exports = { new ManifestRevisionPlugin(path.join('static/', 'manifest.json'), { rootAssetPath: rootAssetPath }), - new webpack.ProvidePlugin({ - $: 'jquery', - jQuery: 'jquery', - 'window.jQuery': 'jquery', - Popper: ['popper.js', 'default'] - }), + // new webpack.ProvidePlugin({ + // bootstrap: 'bootstrap' + // $: 'jquery', + // jQuery: 'jquery', + // 'window.jQuery': 'jquery', + // Popper: ['popper.js', 'default'] + // }), ], }; \ No newline at end of file