diff --git a/.gitignore b/.gitignore index 996340a..ac6d483 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ public/ -node_modules/ +node_modules/date-fns/ assets/jsconfig.json \ No newline at end of file diff --git a/assets/js/main.js b/assets/js/main.js index 7ba537e..afa9ea1 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -12,10 +12,14 @@ import { hello4 } from './lib'; // From the Hugo template. import * as params from '@params'; +// https://github.com/gohugoio/hugo/issues/7948 +import { helloNodeModules } from 'mynodemod'; + window.hello1 = hello1; window.hello2 = hello2; window.hello3 = hello3; window.hello4 = hello4; window.hello6 = hello6; +window.helloNodeModules = helloNodeModules; window.data = data; window.params = params; diff --git a/layouts/index.html b/layouts/index.html index 19cd5a9..02771af 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -17,6 +17,7 @@
+ diff --git a/node_modules/mynodemod/index.js b/node_modules/mynodemod/index.js new file mode 100644 index 0000000..4d28a19 --- /dev/null +++ b/node_modules/mynodemod/index.js @@ -0,0 +1,5 @@ +import { helloFromNodeModules } from './lib'; + +export function helloNodeModules() { + return `Hello from node_modules: ${helloFromNodeModules()}`; +} diff --git a/node_modules/mynodemod/lib/index.js b/node_modules/mynodemod/lib/index.js new file mode 100644 index 0000000..f93a760 --- /dev/null +++ b/node_modules/mynodemod/lib/index.js @@ -0,0 +1,3 @@ +export function helloFromNodeModules() { + return 'Hello from lib in node_modules'; +}