简体   繁体   中英

JS Dynamic import map from npm package.json

I want to import some npm packages like what we normally do in webpack but in pure js import :

import package from 'package-name'

but currently in pure js import we must :

import package from '/node_modules/package-name.js'

does anybody know the way to set some path mapping to pure javascript import ?

I think you need this : deep module . This will help you define custom module aliases for your scripts.

Though you don't need this unless you are using your own modules.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM