[wip] Use yarn to manage frontend dependencies#314
[wip] Use yarn to manage frontend dependencies#314NyanHelsing wants to merge 20 commits intoCenterForOpenScience:developfrom
Conversation
| ####################### | ||
|
|
||
| node_modules | ||
| node_modules/* |
There was a problem hiding this comment.
Don't want node_modules committed
| RUN apt-get install nodejs \ | ||
| apt-get install npm \ | ||
| && npm run build | ||
|
|
There was a problem hiding this comment.
Need to check, should install all deps and build everything into dist
| ```bash | ||
| yarn | ||
| yarn build | ||
| ``` |
There was a problem hiding this comment.
Some instructions
bla
Outdated
| @@ -0,0 +1,92 @@ | |||
| /* Copyright 2017 Mozilla Foundation | |||
There was a problem hiding this comment.
Need to confirm this is needed
|
|
||
| <script src="/static/js/mfr.js"></script> | ||
| <script src="/static/js/mfr.child.js"></script> | ||
| <script src="/assets/mfr.child.js"></script> |
There was a problem hiding this comment.
Only reason mfr.js was included prior was to get pym.js library in the iframe. Webpack builds it in now.
| @@ -0,0 +1,32 @@ | |||
| import {Child} from "pym.js"; | |||
There was a problem hiding this comment.
This file is exactly the same save for this import
| @@ -0,0 +1,131 @@ | |||
| // Mfr.js is a library which renders common file formats to be displayed in an iframe. | |||
There was a problem hiding this comment.
Removes inlined minified pym.js, the rest is the same
| */ | ||
| /* globals module, __non_webpack_require__ */ | ||
|
|
||
| module.exports = require('pdfjs/pdf'); |
There was a problem hiding this comment.
Re exports the pdfjs lib so the viewer can find it properly
| "enablePrintAutoRotate": false, | ||
| "disablePageMode": false, | ||
| "disablePageLabels": false | ||
| } |
There was a problem hiding this comment.
Not sure what to do with this yet. I don't like where it is but pdfjs looks for it in a very particular place.
| }, | ||
| { | ||
| test: /\.js$/i, | ||
| loader: path.join(__dirname, 'node_modules/pdf.js/external/webpack/pdfjsdev-loader.js'), |
There was a problem hiding this comment.
Because pdfjs wrote their own loader
Ticket
Purpose
Changes
Side effects
QA Notes
Deployment Notes