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

前端 未结 10 2183
挽巷
挽巷 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:36

    If you carefully see the foundation-sites 6.2.0 modules, you will find the changes in path as following

    1. foundation-sites/dist/css/foundation.min.css
    2. foundation-sites/dist/js/foundation.min.js

    So basically you have to changes in webpack confing files entry as following

    module.exports =  {
             entry: ['script!jquery/dist/jquery.min.js',
            'script!foundation-sites/dist/js/foundation.min.js',
             './app/app.jsx'
           ]
    }
    

    and the entry for style should be like this

    require('style!css!foundation-sites/dist/css/foundation.min.css');

提交回复
热议问题