2017-05-28 16:49:00 +00:00
|
|
|
const webpack = require('webpack');
|
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: {
|
2018-02-25 19:54:15 +00:00
|
|
|
root: ['babel-polyfill', './src/root.js'],
|
2018-04-02 09:58:32 +00:00
|
|
|
mosaico: ['babel-polyfill', './src/lib/mosaico-sandbox-root.js'],
|
2017-05-28 16:49:00 +00:00
|
|
|
},
|
|
|
|
output: {
|
|
|
|
library: 'MailtrainReactBody',
|
|
|
|
filename: '[name].js',
|
|
|
|
path: path.resolve(__dirname, 'dist')
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
2017-08-16 14:10:30 +00:00
|
|
|
{
|
|
|
|
test: /\.(js|jsx)$/,
|
2018-03-24 22:55:50 +00:00
|
|
|
exclude: /(disposables|react-dnd-touch-backend|attr-accept)/ /* https://github.com/react-dnd/react-dnd/issues/407 */,
|
2017-08-16 14:10:30 +00:00
|
|
|
use: [ 'babel-loader' ]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.css$/,
|
|
|
|
use: [ 'style-loader', 'css-loader' ]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(png|jpg|gif)$/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'url-loader',
|
|
|
|
options: {
|
|
|
|
limit: 8192 // inline base64 URLs for <=8k images, direct URLs for the rest
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
|
|
|
exclude: path.join(__dirname, 'node_modules'),
|
|
|
|
use: [
|
|
|
|
'style-loader',
|
|
|
|
{
|
|
|
|
loader: 'css-loader',
|
|
|
|
options: {
|
|
|
|
modules: true,
|
|
|
|
localIdentName: '[path][name]__[local]--[hash:base64:5]'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'sass-loader' ]
|
|
|
|
},
|
2018-02-24 20:59:00 +00:00
|
|
|
{
|
|
|
|
test: /\.(woff|ttf|eot)$/,
|
|
|
|
use: [ 'url-loader' ]
|
|
|
|
}
|
2017-05-28 16:49:00 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
externals: {
|
2017-06-04 11:16:29 +00:00
|
|
|
jquery: 'jQuery',
|
2017-07-08 13:48:34 +00:00
|
|
|
csfrToken: 'csfrToken',
|
|
|
|
mailtrainConfig: 'mailtrainConfig'
|
2017-05-28 16:49:00 +00:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
// new webpack.optimize.UglifyJsPlugin(),
|
|
|
|
new webpack.optimize.CommonsChunkPlugin('common')
|
2017-06-21 00:14:14 +00:00
|
|
|
],
|
|
|
|
watchOptions: {
|
|
|
|
ignored: 'node_modules/',
|
|
|
|
poll: 1000
|
|
|
|
}
|
2017-05-28 16:49:00 +00:00
|
|
|
};
|