webpack - require('node_modules/leaflet/leaflet.css')

前端 未结 2 497
别跟我提以往
别跟我提以往 2021-02-02 15:51

So I\'m trying to build a map app using webpack and leaflet. I can require leaflet.js from my map.js file, but I can\'t call

2条回答
  •  执念已碎
    2021-02-02 16:03

    I managed to do it easier. Just needed to add loaders for css and for png

    loaders: [
        { test: /\.css$/, loader: 'style-loader!css-loader' },
        {
            test: /\.png$/,
            loader: 'url-loader',
            query: { mimetype: 'image/png' }
        }
    ]
    

提交回复
热议问题