maputnik/config/webpack.loaders.js

56 lines
1.6 KiB
JavaScript
Raw Normal View History

2015-06-15 15:21:19 +02:00
module.exports = [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components|public)/,
loaders: ['react-hot-loader/webpack']
},
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>
{
2018-01-25 20:58:01 +01:00
test: /.*node_modules[\/\\]mapbox-gl[\/\\]src[\/\\]util[\/\\].*\.js/,
2018-01-25 20:12:04 +01:00
loader: 'babel-loader',
query: {
presets: ['env', 'react', 'flow'],
plugins: ['transform-runtime', 'transform-decorators-legacy', 'transform-class-properties'],
}
},
{
test: /\.jsx?$/,
// Note: These modules aren't ES5 therefore we much compile them.
exclude: /(.*node_modules(?![\/\\](@mapbox[\/\\]mapbox-gl-style-spec|ol|mapbox-to-ol-style))|bower_components|public)/,
2017-11-07 12:05:30 +01:00
loader: 'babel-loader',
query: {
2017-11-07 12:05:30 +01:00
presets: ['env', 'react'],
plugins: ['transform-runtime', 'transform-decorators-legacy', 'transform-class-properties'],
}
},
{
2016-12-31 10:34:32 +01:00
test: /\.(eot|ttf|woff|woff2)$/,
2017-11-07 12:05:30 +01:00
loader: 'file-loader?name=fonts/[name].[ext]'
},
{
2016-12-31 10:34:32 +01:00
test: /\.ico$/,
2017-11-07 12:05:30 +01:00
loader: 'file-loader?name=[name].[ext]'
},
{
2016-12-31 10:34:32 +01:00
test: /\.(svg|gif|jpg|png)$/,
2017-11-07 12:05:30 +01:00
loader: 'file-loader?name=img/[name].[ext]'
},
{
test: /\.json$/,
loader: 'json-loader'
},
2017-01-10 21:28:30 +01:00
{
test: /[\/\\](node_modules|global|src)[\/\\].*\.scss$/,
loaders: ["style-loader", "css-loader", "sass-loader"]
},
2016-12-22 18:19:34 +01:00
{
test: /[\/\\](node_modules|global|src)[\/\\].*\.css$/,
loaders: [
2017-11-07 12:05:30 +01:00
'style-loader?sourceMap',
'css-loader'
2016-12-22 18:19:34 +01:00
]
}
2015-06-15 15:21:19 +02:00
];