Git Product home page Git Product logo

Comments (7)

zzacharo avatar zzacharo commented on June 21, 2024 1

For making it work on macos I had to change unfortunately another line in the DirectoryWatcher.js:

function DirectoryWatcher(directoryPath, options) {
        ...
	this.watcher = chokidar.watch(directoryPath, {
                ...
		followSymlinks: true,
                 depth: 1,

Seems that on macos if you don't increase the depth of the traversed subdirectories changes are not detected. I have opened a ticket webpack/watchpack#141 to understand if this is something is known and fixed in the latest beta version.

from invenio-app-rdm.

ppanero avatar ppanero commented on June 21, 2024

Made to work in debug mode. Steps to follow:

  1. Install invenio-app-rdm.
  2. Edit the config.py and add:
from invenio_app.config import APP_DEFAULT_SECURE_HEADERS

APP_DEFAULT_SECURE_HEADERS['content_security_policy'] = {}
WEBPACKEXT_STORAGE_CLS = 'pywebpack.storage.LinkStorage'
  1. Install invenio-assets from GitHub master branch.
    • Edit the invenio_assets/assets/build/webpack.config.js and add:
var webpackConfig = {
  ...
  resolve: {
    ...
    symlinks: false
  },
...
}
  1. Since --watch does not work with symlinks we need to edit DirectoryWatcher.js. Edit <instance_path>/assets/node_modules/watchpack/lib/DirectoryWatcher.js
function DirectoryWatcher(directoryPath, options) {
        ...
	this.watcher = chokidar.watch(directoryPath, {
                ...
		followSymlinks: true,
  1. Open two terminals: In each one of them export:

    • FLASK_ENV=development
    • NODE_PRESERVE_SYMLINKS=1
  2. In Terminal 1 run:

./scripts/bootstrap
./scripts/setup
 invenio run --cert ./docker/nginx/test.t --key ./docker/nginx/test.key 
  1. In Terminal 2 run:
invenio webpack run start

Starting implementing the changes in the correct places.

Kudos @slint for the guidelines and work :)

from invenio-app-rdm.

slint avatar slint commented on June 21, 2024

Since it's not sure if more changes are coming, I've made the webpack-fixes WIP branch in invenio-assets, which can be checked out and contains part of the changes (specifically steps 3 and 5)

from invenio-app-rdm.

ppanero avatar ppanero commented on June 21, 2024

@slint Thanks! I added a comment here: inveniosoftware/invenio-assets@094c1ef

The most problematic might be point 4.

followSymlinks was added on watchpack (see webpack/watchpack#114). However, it is not compatible with webpack 4 (it cannot be set from there) and as stated here webpack/webpack#6845 it will come with webpack 5...

While searching for the option I did not find it. So I guess it is fixed somehow different in webpack 5 (I'll keep investigating)

Thoughts?

from invenio-app-rdm.

lnielsen avatar lnielsen commented on June 21, 2024

Isn't this solved by #59 ?

from invenio-app-rdm.

zzacharo avatar zzacharo commented on June 21, 2024

@lnielsen if we move the information on how to you can make webpack work locally in another issue this one can be closed! I will create an issue and I will close it!

from invenio-app-rdm.

zzacharo avatar zzacharo commented on June 21, 2024

Created this #65 out of the information here!

from invenio-app-rdm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.