Skip to content

Commit

Permalink
Feat: Adds js alias to root/app/js
Browse files Browse the repository at this point in the history
Issue #77

Found the best explanation here:
https://webpack.js.org/configuration/resolve/#resolvealias

With this setting, all files and folders in js can now
be referenced with the js alias,
e.g. a module app/js/module.js should be imported in
index.js as js/module.js.

app/js/foo/hello.js should be imported in index.js as
js/foo/hello.js.
  • Loading branch information
vibalre committed Oct 20, 2022
1 parent fb19098 commit 43406c3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions inst/templates/node/webpack.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import { join } from 'path';
export default {
mode: 'production',
entry: join(__dirname, 'root', 'app', 'js', 'index.js'),
resolve: {
alias: {
js: resolve(__dirname, 'root/app/js'),
},
},
output: {
library: 'App',
path: join(__dirname, 'root', 'app', 'static', 'js'),
Expand Down

0 comments on commit 43406c3

Please sign in to comment.