NPM + Zurb Foundation + WebPack: Cannot resolve module 'foundation'

前端 未结 10 2212
挽巷
挽巷 2020-12-23 17:59

I am working on using Zurb Foundation with WebPack and NPM, without Bower.

The problem I am encountering is the same as this below:

https://github.c

10条回答
  •  感动是毒
    2020-12-23 18:26

    Just use the script-loader (npm i script-loader) and prefix your imports with a script!. Then it will be evaluated in the global scope.

    To load all js files from foundation use this

    import 'script!jquery'
    import 'script!what-input'
    import 'script!foundation-sites'
    

    Like I do it in my entry point

    You can check out my boilerplate project to try it out: https://github.com/timaschew/r3-foundation-boilerplate

提交回复
热议问题