Jay Taylor's notes

back to listing index

From Require.js to Webpack - Part 2 (the how)

[web search]
Original source (gist.github.com)
Tags: javascript webpack nodejs requirejs npm gist.github.com
Clipped on: 2017-07-02

Image (Asset 1/20) alt= I've found that aliases with "/" on them don't translate well to webpack:

See

"app/user/actions": "/the/directory/some/more/folders/the_file"

Compiler then complains when a module tries to require it, it looks like it does not resolve properly the path
Instead of resolving to :

"/the/directory/some/more/folders/the_file"

It resolves to:

"/the/directory/some/more/folders/app/user/actions"

Image (Asset 2/20) alt= require example: require(["promise!file-that-need-be-loaded-with-promise-plugin"], function(module){ ... });