2016-10-06 15:59:19 +02:00
|
|
|
/* eslint global-require: 0 */
|
|
|
|
|
2016-09-15 20:04:45 +02:00
|
|
|
const webpack = require('webpack');
|
2017-06-12 17:59:58 -07:00
|
|
|
const path = require('path');
|
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: {
|
2017-06-12 17:59:58 -07:00
|
|
|
rules: [
|
2016-02-25 00:45:56 -08:00
|
|
|
{
|
2016-11-23 19:22:49 +01:00
|
|
|
test: /\.js?$/,
|
2017-06-12 17:59:58 -07:00
|
|
|
use: 'babel-loader',
|
2016-11-23 19:22:49 +01:00
|
|
|
exclude: /node_modules/,
|
2016-02-25 00:45:56 -08:00
|
|
|
},
|
2016-09-15 18:53:24 +02:00
|
|
|
{
|
2017-10-02 20:37:20 -06:00
|
|
|
/* CSS loader for npm modules that are shipped with CSS that should be loaded without processing.
|
2016-11-23 19:22:49 +01:00
|
|
|
List all of theme in the array
|
|
|
|
*/
|
|
|
|
test: /\.css$/,
|
2017-10-02 20:39:24 -06:00
|
|
|
include: [/redux-notifications/, /normalize.css/],
|
2017-10-02 20:37:20 -06:00
|
|
|
use: ExtractTextPlugin.extract({
|
|
|
|
fallback: 'style-loader',
|
|
|
|
use: 'css-loader',
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
{
|
2017-10-02 20:41:52 -06:00
|
|
|
/* React-toolbox relies on PostCSS and css-modules */
|
2017-10-02 20:37:20 -06:00
|
|
|
test: /\.css$/,
|
2017-10-02 20:39:24 -06:00
|
|
|
include: [/react-toolbox/],
|
2017-06-12 17:59:58 -07:00
|
|
|
use: ExtractTextPlugin.extract({
|
|
|
|
fallback: 'style-loader',
|
|
|
|
use: [
|
2017-08-23 14:06:34 -04:00
|
|
|
{
|
|
|
|
loader: 'css-loader',
|
|
|
|
options: {
|
|
|
|
modules: true,
|
|
|
|
importLoaders: 1,
|
|
|
|
localIdentName: "[name]__[local]__[hash:base64:8]"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{ loader: 'postcss-loader' },
|
2017-06-12 17:59:58 -07:00
|
|
|
],
|
|
|
|
}),
|
2016-09-15 18:53:24 +02:00
|
|
|
},
|
2016-06-28 15:28:42 -03:00
|
|
|
{
|
2017-10-18 09:29:38 -07:00
|
|
|
/* We use PostCSS for CMS styles */
|
2016-06-28 15:28:42 -03:00
|
|
|
test: /\.css$/,
|
2017-08-23 14:06:34 -04:00
|
|
|
exclude: [/node_modules/],
|
2017-06-12 17:59:58 -07:00
|
|
|
use: ExtractTextPlugin.extract({
|
|
|
|
fallback: 'style-loader',
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'css-loader',
|
|
|
|
options: {
|
|
|
|
importLoaders: 1,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{ loader: 'postcss-loader' },
|
|
|
|
],
|
|
|
|
}),
|
2016-06-28 15:28:42 -03:00
|
|
|
},
|
2016-02-25 00:45:56 -08:00
|
|
|
{
|
2016-11-23 19:22:49 +01:00
|
|
|
test: /\.(png|eot|woff|woff2|ttf|svg|gif)(\?v=\d+\.\d+\.\d+)?$/,
|
2017-06-12 17:59:58 -07:00
|
|
|
use: { loader: "url-loader", options: { limit: 10000 } },
|
2016-10-06 15:59:19 +02:00
|
|
|
},
|
|
|
|
],
|
2016-02-25 00:45:56 -08:00
|
|
|
},
|
2016-10-06 15:59:19 +02:00
|
|
|
plugins: [
|
2017-09-29 20:47:35 -06:00
|
|
|
new webpack.IgnorePlugin(/^esprima$/, /js-yaml/), // Ignore Esprima import for js-yaml
|
2016-10-26 19:51:35 +02:00
|
|
|
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), // Ignore all optional deps of moment.js
|
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
|
|
|
};
|