2016-10-06 15:59:19 +02:00
|
|
|
/* eslint global-require: 0 */
|
|
|
|
|
2016-09-15 20:04:45 +02:00
|
|
|
const webpack = require('webpack');
|
2016-10-26 19:51:35 +02:00
|
|
|
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
2016-09-13 17:08:26 +02:00
|
|
|
|
2016-02-25 00:45:56 -08:00
|
|
|
module.exports = {
|
|
|
|
module: {
|
|
|
|
loaders: [
|
|
|
|
{
|
2016-10-12 19:17:37 +02:00
|
|
|
test: /\.(png|eot|woff|woff2|ttf|svg|gif)(\?v=\d+\.\d+\.\d+)?$/,
|
2016-10-26 19:51:35 +02:00
|
|
|
loader: 'url-loader?limit=10000',
|
2016-02-25 00:45:56 -08:00
|
|
|
},
|
2016-09-15 18:53:24 +02:00
|
|
|
{
|
|
|
|
test: /\.json$/,
|
2016-10-06 15:59:19 +02:00
|
|
|
loader: 'json-loader',
|
2016-09-15 18:53:24 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
2016-10-26 19:51:35 +02:00
|
|
|
loader: ExtractTextPlugin.extract('style', 'css?modules!sass'),
|
2016-09-15 18:53:24 +02:00
|
|
|
},
|
2016-06-28 15:28:42 -03:00
|
|
|
{
|
|
|
|
test: /\.css$/,
|
2016-10-26 19:51:35 +02:00
|
|
|
loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&&localIdentName=cms__[name]__[local]!postcss'),
|
2016-06-28 15:28:42 -03:00
|
|
|
},
|
2016-02-25 00:45:56 -08:00
|
|
|
{
|
|
|
|
loader: 'babel',
|
|
|
|
test: /\.js?$/,
|
2016-10-26 19:51:35 +02:00
|
|
|
exclude: /node_modules/,
|
2016-10-06 15:59:19 +02:00
|
|
|
},
|
|
|
|
],
|
2016-02-25 00:45:56 -08:00
|
|
|
},
|
2016-06-28 15:28:42 -03:00
|
|
|
postcss: [
|
2016-07-05 15:48:18 -03:00
|
|
|
require('postcss-import')({ addDependencyTo: webpack }),
|
2016-10-26 19:51:35 +02:00
|
|
|
require('postcss-cssnext')({
|
|
|
|
browsers: ['last 2 versions', 'IE > 10'],
|
|
|
|
}),
|
2016-10-06 15:59:19 +02:00
|
|
|
],
|
|
|
|
plugins: [
|
2016-10-26 19:51:35 +02:00
|
|
|
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), // Ignore all optional deps of moment.js
|
|
|
|
new webpack.ProvidePlugin({
|
|
|
|
fetch: 'imports?this=>global!exports?global.fetch!whatwg-fetch',
|
2016-10-06 15:59:19 +02:00
|
|
|
}),
|
2016-06-28 15:28:42 -03:00
|
|
|
],
|
2016-10-26 19:51:35 +02:00
|
|
|
target: 'web', // Make web variables accessible to webpack, e.g. window
|
2016-02-25 00:45:56 -08:00
|
|
|
};
|