maputnik/config/webpack.loaders.js

55 lines
1.3 KiB
JavaScript
Raw Normal View History

2018-10-06 22:05:33 +02:00
const path = require("path");
2015-06-15 15:21:19 +02:00
module.exports = [
{
test: /\.jsx?$/,
2018-10-06 22:05:33 +02:00
exclude: [
path.resolve(__dirname, '../node_modules')
],
use: 'babel-loader'
},
2018-01-25 20:12:04 +01:00
// HACK: This is a massive hack and reaches into the mapbox-gl private API.
// We have to include this for access to `normalizeSourceURL`. We should
// remove this ASAP, see <https://github.com/mapbox/mapbox-gl-js/issues/2416>
{
test: /\.jsx?$/,
2018-10-06 22:05:33 +02:00
include: [
path.resolve(__dirname, '../node_modules/mapbox-gl/src/util/')
],
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-flow'],
plugins: ['@babel/plugin-transform-runtime', '@babel/plugin-proposal-class-properties'],
}
}
},
{
2016-12-31 10:34:32 +01:00
test: /\.(eot|ttf|woff|woff2)$/,
2018-10-06 22:05:33 +02:00
use: 'file-loader?name=fonts/[name].[ext]'
},
{
2016-12-31 10:34:32 +01:00
test: /\.ico$/,
2018-10-06 22:05:33 +02:00
use: 'file-loader?name=[name].[ext]'
},
{
2016-12-31 10:34:32 +01:00
test: /\.(svg|gif|jpg|png)$/,
2018-10-06 22:05:33 +02:00
use: 'file-loader?name=img/[name].[ext]'
},
2017-01-10 21:28:30 +01:00
{
test: /[\/\\](node_modules|global|src)[\/\\].*\.scss$/,
2018-10-06 22:05:33 +02:00
use: [
'style-loader',
"css-loader",
"sass-loader"
]
2017-01-10 21:28:30 +01:00
},
2016-12-22 18:19:34 +01:00
{
test: /[\/\\](node_modules|global|src)[\/\\].*\.css$/,
2018-10-06 22:05:33 +02:00
use: [
'style-loader',
2017-11-07 12:05:30 +01:00
'css-loader'
2016-12-22 18:19:34 +01:00
]
}
2015-06-15 15:21:19 +02:00
];