Skip to content

Commit

Permalink
webpack: fix symlinking issues
Browse files Browse the repository at this point in the history
  • Loading branch information
slint committed Jan 13, 2020
1 parent a3dd0e9 commit 094c1ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion invenio_assets/assets/build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ var webpackConfig = {
entry: config.entry,
context: config.build.context,
resolve: {
extensions: ['*', '.js', '.jsx']
extensions: ['*', '.js', '.jsx'],
symlinks: false,
},
output: {
path: config.build.assetsPath,
Expand Down
4 changes: 2 additions & 2 deletions invenio_assets/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"author": "CERN <info@inveniosoftware.org>",
"private": true,
"scripts": {
"start": "NODE_ENV=development webpack --watch --progress --config ./build/webpack.config.js",
"build": "NODE_ENV=production webpack --config ./build/webpack.config.js"
"start": "NODE_PRESERVE_SYMLINKS=1 NODE_ENV=development webpack --watch --progress --config ./build/webpack.config.js",
"build": "NODE_PRESERVE_SYMLINKS=1 NODE_ENV=production webpack --config ./build/webpack.config.js"

This comment has been minimized.

Copy link
@ppanero

ppanero Jan 14, 2020

Member

@slint is NODE_PRESERVE_SYMLINKS=1 needed in "production mode". I understand that the build will create a copy of those and it should work no?

I am thinking of the following workflow:

  • I want to develop and have hot reloading. I use start
  • I want to build the final version I did when developing. I use build. Build should be self contained in case I change more things during development.

This comment has been minimized.

Copy link
@slint

slint Jan 14, 2020

Author Member

I agree that would be the more appropriate behavior. The issue is that this is bound to the WEBPACKEXT_STORAGE_CLS config (i.e. if it's set to FileStorage or LinkStorage) and e.g. invenio webpack build is already running in the ./scripts/bootstrap... A solution would be to override it via INVENIO_ env config, but I think it's better to think of the overall use cases and have a central point/config that decides these switches, e.g. FLASK_ENV=(production|development) (maybe also introducing INVENIO_ENV as a global setting, usable inside both the Python and Node/Javascript environments)

},
"dependencies": {},
"devDependencies": {
Expand Down

0 comments on commit 094c1ef

Please sign in to comment.