Advertisement
Guest User

Fix webpack multiple imports with different paths

a guest
Aug 26th, 2014
393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //example using gulp with webpack
  2. var path = require('path')
  3.  
  4. resolve: {
  5.     alias: {
  6.         //if you prefix all js imports with app this will fix any issues from importating
  7.         js: path.join(__dirname, "src/js")
  8.     },
  9. }
  10.  
  11. //then you would use this to require
  12. var myfie = require('js/somefolder/myfile')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement